From 697ef7dd68442fb2f3291c5196a00b54ba25a3bb Mon Sep 17 00:00:00 2001 From: Asher Kach Date: Mon, 28 Oct 2019 13:08:37 -0500 Subject: [PATCH] Simplify the Fahrenheit from Celsius computation. (#2497) As the micro:bit introduces floating point arithmetic for both the existing `f = 18 * c / 10 + 32` computation and the new `f = 1.8 * c + 32` computation, there isn't any benefit for the former. --- docs/reference/input/temperature.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference/input/temperature.md b/docs/reference/input/temperature.md index e068a9f7..654bd135 100644 --- a/docs/reference/input/temperature.md +++ b/docs/reference/input/temperature.md @@ -38,12 +38,12 @@ basic.forever(() => { This program measures the temperature using Fahrenheit degrees. Fahrenheit is a way of measuring temperature that is commonly used in the United States. To make a Celsius temperature into a Fahrenheit one, multiply the Celsius temperature by -``18``, divide by ``10`` and add ``32``. +``1.8`` and add ``32``. ```blocks basic.forever(() => { let c = input.temperature() - let f = (c * 18) / 10 + 32 + let f = (1.8 * c) + 32 basic.showNumber(f) }) ```