Skip to content

Commit

Permalink
update api docs to warn about isNegative pitfall
Browse files Browse the repository at this point in the history
  • Loading branch information
Mazuh authored May 24, 2020
1 parent 5a6e138 commit 39991b8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions doc/API.html
Original file line number Diff line number Diff line change
Expand Up @@ -1659,7 +1659,15 @@ <h5 id="isNeg">isNegative<code class='inset'>.isNeg() <i>&rArr; boolean</i></cod
y.isNeg // false</pre>
<p>Note: <code>n &lt; 0</code> can be used if <code>n &lt;= -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>&rArr; boolean</i></code></h5>
<p>
Expand Down

0 comments on commit 39991b8

Please sign in to comment.