mirror of
https://github.com/MikeMcl/decimal.js.git
synced 2024-10-27 20:34:12 +00:00
Merge pull request #149 from Mazuh/patch-2
update api docs to warn about isNegative pitfall
This commit is contained in:
commit
11699c1d1c
@ -1659,7 +1659,15 @@ y = new Decimal(2)
|
|||||||
y.isNeg // false</pre>
|
y.isNeg // false</pre>
|
||||||
<p>Note: <code>n < 0</code> can be used if <code>n <= -Number.MIN_VALUE</code>.</p>
|
<p>Note: <code>n < 0</code> can be used if <code>n <= -Number.MIN_VALUE</code>.</p>
|
||||||
|
|
||||||
|
<p>Also note that signed zeroes are implemented, following the IEEE Standard
|
||||||
|
for Floating-Point Arithmetic (IEEE 754).</p>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
Decimal(0).valueOf() // '0'
|
||||||
|
Decimal(0).isNegative() // false
|
||||||
|
Decimal(0).negated().valueOf() // '-0'
|
||||||
|
Decimal(0).negated().isNegative() // true
|
||||||
|
</pre>
|
||||||
|
|
||||||
<h5 id="isPos">isPositive<code class='inset'>.isPos() <i>⇒ boolean</i></code></h5>
|
<h5 id="isPos">isPositive<code class='inset'>.isPos() <i>⇒ boolean</i></code></h5>
|
||||||
<p>
|
<p>
|
||||||
|
Loading…
Reference in New Issue
Block a user