Skip to content

Commit

Permalink
Add note that a Big is created from a numbers toString value
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMcl committed Jun 3, 2022
1 parent 1ef0018 commit f8ad6c9
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,8 @@ <h1>big.js</h1>
<h2>API</h2>

<p>
In all examples below, <code>var</code> and semicolons are not shown, and
if a commented-out value is in quotes it means <code>toString</code> has
been called on the preceding expression.
For brevity, <code>var</code>, semicolons and <code>toString</code> calls
have been omitted in the examples below.
</p>


Expand All @@ -169,6 +168,12 @@ <h5 id="big">
but if <a href='#strict'><code>Big.strict</code></a> is set to <code>true</code>
an error will be thrown if <code>n</code> is not a string or Big number.
</p>
<p>
Note that primitive numbers are accepted purely as a convenience so that quotes
don't need to be typed for numeric literals of up to 15 significant digits, and
that a Big number is created from a number's <code>toString</code> value rather
than from its underlying binary floating point value.
</p>
<p>
<code>Infinity</code>, <code>NaN</code> and hexadecimal literal
strings, e.g. '0xff', are <u>not</u> valid.
Expand All @@ -178,21 +183,20 @@ <h5 id="big">
e.g. '011' is 11, not 9.
</p>
<p>
String values may be in exponential, as well as normal (non-exponential)
notation.
String values may be in exponential, as well as normal notation.
</p>
<p>
There is no limit to the number of digits of a <em>string</em> value
(other than that of JavaScript's maximum array size), but the largest
recommended exponent magnitude is 1000000.
</p>
<p>Returns a new Big number object with value <code>n</code>.</p>
<p>Returns a new Big number with value <code>n</code>.</p>
<p>Throws if <code>n</code> is invalid.</p>
<p>
Using <code>new</code> with Big is optional, but note that if no argument
is passed when doing so, or if the argument is <code>undefined</code>,
then a new Big constructor will be returned rather than a new Big number
instance. See <a href='#multiple'>creating additional Big number constructors</a>
then a new Big constructor will be returned rather than a new Big number.
See <a href='#multiple'>creating additional Big number constructors</a>
below.
</p>
<pre>
Expand Down

0 comments on commit f8ad6c9

Please sign in to comment.