From 7215866b2e84bf103ed276390869841162a28031 Mon Sep 17 00:00:00 2001 From: Anton Krekotun <36279559+tonchique@users.noreply.github.com> Date: Fri, 16 Oct 2020 16:18:30 +0300 Subject: [PATCH] added reference to IEEE-754 --- content/questions/floating-point-precision/index.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/questions/floating-point-precision/index.md b/content/questions/floating-point-precision/index.md index fd3a038f..7570e64b 100644 --- a/content/questions/floating-point-precision/index.md +++ b/content/questions/floating-point-precision/index.md @@ -25,4 +25,6 @@ console.log(a + b === c); In computing, decimal numbers as we know them are most commonly represented using floating-point arithmetic. Floating-point numbers only approximate real numbers and cannot accurately represent numbers like `0.1`, `0.2` or `0.3` at all. In the case of `0.1 + 0.2`, this results in small rounding errors before we even get to the addition part. The final sum then equals to `0.30000000000000004`. -Similarly, the decimal system cannot represent `1/3` (one third) accurately. And if we took a rounded value like `0.333`, you wouldn't expect `0.333 + 0.333 + 0.333` to add up to `1`, either. \ No newline at end of file +Similarly, the decimal system cannot represent `1/3` (one third) accurately. And if we took a rounded value like `0.333`, you wouldn't expect `0.333 + 0.333 + 0.333` to add up to `1`, either. + +For more information check out [64-bit format IEEE-754, also known as “double precision floating point numbers”](https://en.wikipedia.org/wiki/IEEE_754-2008_revision).