From a56f15f374a3b47467c25d8c40cf96c4ebc1597f Mon Sep 17 00:00:00 2001 From: Marcell Guilherme Costa da Silva Date: Thu, 7 May 2020 01:01:50 -0300 Subject: [PATCH] advice about negative zeroes on README --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 34189e9..dd3a8da 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,17 @@ Decimal.sqrt('6.98372465832e+9823') // '8.3568682281821340204e+4911' Decimal.pow(2, 0.0979843) // '1.0702770511687781839' ``` +Note that signed zeroes are implemented, following the IEEE Standard +for Floating-Point Arithmetic (IEEE 754). + +```js +Decimal(0).valueOf() // '0' +Decimal(0).isNegative() // false + +Decimal(0).negated().valueOf() // '-0' +Decimal(0).negated().isNegative() // true +``` + There are `isNaN` and `isFinite` methods, as `NaN` and `Infinity` are valid `Decimal` values, ```js