From fd1eaf40b6cf2dca27fe3a19a20ade5690157235 Mon Sep 17 00:00:00 2001 From: Alexander Date: Fri, 29 Sep 2017 04:39:12 +0300 Subject: [PATCH] Typo & spacing --- 1-js/05-data-types/02-number/article.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/1-js/05-data-types/02-number/article.md b/1-js/05-data-types/02-number/article.md index 0a9feb1c..16e4275e 100644 --- a/1-js/05-data-types/02-number/article.md +++ b/1-js/05-data-types/02-number/article.md @@ -249,10 +249,10 @@ Can we work around the problem? Sure, there're a number of ways: 2. We can temporarily turn numbers into integers for the maths and then revert it back. It works like this: ```js run - alert( (0.1*10 + 0.2*10) / 10 ); // 0.3 + alert( (0.1 * 10 + 0.2 * 10) / 10 ); // 0.3 ``` - This works because when we do `0.1*10 = 1` and `0.2 * 10 = 2` then both numbers become integers, and there's no precision loss. + This works because when we do `0.1 * 10 = 1` and `0.2 * 10 = 2` then both numbers become integers, and there's no precision loss. 3. If we were dealing with a shop, then the most radical solution would be to store all prices in cents and use no fractions at all. But what if we apply a discount of 30%? In practice, totally evading fractions is rarely feasible, so the solutions above help avoid this pitfall. @@ -270,7 +270,7 @@ JavaScript doesn't trigger an error in such events. It does its best to fit the ```` ```smart header="Two zeroes" -Another funny consequence of the internal representation of numbers is the existance of two zeroes: `0` and `-0`. +Another funny consequence of the internal representation of numbers is the existence of two zeroes: `0` and `-0`. That's because a sign is represented by a single bit, so every number can be positive or negative, including a zero.