From 079611355850db7b2c8be8cdd9a62c793cd68a19 Mon Sep 17 00:00:00 2001 From: Oso Oluwafemi Date: Tue, 4 Jul 2017 11:20:28 +0100 Subject: [PATCH] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e384781..67ec0f7 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ var ba = new BigArith(12345); //initialize ba to a BigArith object of value "123 ``` The number must be between the `Number.MIN_SAFE_INTEGER` (-9007199254740991) and `Number.MAX_SAFE_INTEGER` (9007199254740991) limits else a `RangeError` will be thrown. Please note that only integers are recommended for this method because of the floating point precision _problem_ in JavaScript (which is one of the problems bigarith.js aim to solve). -Doing `var ba = new BigArith(0.45);` might still be considered _"safe"_ but some could be tempted to do `var ba = new BigArith(0.1 \* 0.2);`. As it is known `0.1 \* 0.2` will not give `0.02` in JavaScript but rather `0.020000000000000004`. Therefore, it is better to avoid initializing fractional numbers this way. +Doing `var ba = new BigArith(0.45);` might still be considered _"safe"_ but some could be tempted to do `var ba = new BigArith(0.1*0.2);`. As it is known `0.1*0.2` will not give `0.02` in JavaScript but rather `0.020000000000000004`. Therefore, it is better to avoid initializing fractional numbers this way. > It is recommended fractional numbers are initialized with strings. > See [here](#init_string). @@ -200,4 +200,4 @@ See also: 26. [truncate()](https://osofem.github.io/bigarith.js/documentation/truuncate.html) 27. [negate()](https://osofem.github.io/bigarith.js/documentation/negate.html) -Full documentation is [here](https://github.com/osofem/bigarith.js/tree/master/documentation). \ No newline at end of file +Full documentation is [here](https://github.com/osofem/bigarith.js/tree/master/documentation).