Skip to content

Commit

Permalink
other numeric methods
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelficarra committed Sep 17, 2021
1 parent 06eb272 commit 1102b66
Showing 1 changed file with 37 additions and 37 deletions.
74 changes: 37 additions & 37 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -28182,7 +28182,7 @@ <h1>parseInt ( _string_, _radix_ )</h1>
1. If _S_ contains a code unit that is not a radix-_R_ digit, let _end_ be the index within _S_ of the first such code unit; otherwise, let _end_ be the length of _S_.
1. Let _Z_ be the substring of _S_ from 0 to _end_.
1. If _Z_ is empty, return *NaN*.
1. Let _mathInt_ be the integer value that is represented by _Z_ in radix-_R_ notation, using the letters <b>A</b>-<b>Z</b> and <b>a</b>-<b>z</b> for digits with values 10 through 35. (However, if _R_ is 10 and _Z_ contains more than 20 significant digits, every significant digit after the 20th may be replaced by a 0 digit, at the option of the implementation; and if _R_ is not 2, 4, 8, 10, 16, or 32, then _mathInt_ may be an implementation-approximated value representing the integer value that is represented by _Z_ in radix-_R_ notation.)
1. Let _mathInt_ be the integer value that is represented by _Z_ in radix-_R_ notation, using the letters <b>A</b>-<b>Z</b> and <b>a</b>-<b>z</b> for digits with values 10 through 35. (However, if _R_ is 10 and _Z_ contains more than 20 significant digits, every significant digit after the 20th may be replaced by a 0 digit, at the option of the implementation; and if _R_ is not 2, 4, 8, 10, 16, or 32, then _mathInt_ may be an implementation-approximated integer representing the integer value denoted by _Z_ in radix-_R_ notation.)
1. If _mathInt_ = 0, then
1. If _sign_ = -1, return *-0*<sub>𝔽</sub>.
1. Return *+0*<sub>𝔽</sub>.
Expand Down Expand Up @@ -30924,7 +30924,7 @@ <h1>Math.acos ( _x_ )</h1>
1. Let _n_ be ? ToNumber(_x_).
1. If _n_ is *NaN*, _n_ &gt; *1*<sub>𝔽</sub>, or _n_ &lt; *-1*<sub>𝔽</sub>, return *NaN*.
1. If _n_ is *1*<sub>𝔽</sub>, return *+0*<sub>𝔽</sub>.
1. Return an implementation-approximated value representing the result of the inverse cosine of ℝ(_n_).
1. Return an implementation-approximated Number value representing the result of the inverse cosine of ℝ(_n_).
</emu-alg>
</emu-clause>

Expand All @@ -30937,7 +30937,7 @@ <h1>Math.acosh ( _x_ )</h1>
1. If _n_ is *NaN* or _n_ is *+&infin;*<sub>𝔽</sub>, return _n_.
1. If _n_ is *1*<sub>𝔽</sub>, return *+0*<sub>𝔽</sub>.
1. If _n_ &lt; *1*<sub>𝔽</sub>, return *NaN*.
1. Return an implementation-approximated value representing the result of the inverse hyperbolic cosine of ℝ(_n_).
1. Return an implementation-approximated Number value representing the result of the inverse hyperbolic cosine of ℝ(_n_).
</emu-alg>
</emu-clause>

Expand All @@ -30949,7 +30949,7 @@ <h1>Math.asin ( _x_ )</h1>
1. Let _n_ be ? ToNumber(_x_).
1. If _n_ is *NaN*, _n_ is *+0*<sub>𝔽</sub>, or _n_ is *-0*<sub>𝔽</sub>, return _n_.
1. If _n_ &gt; *1*<sub>𝔽</sub> or _n_ &lt; *-1*<sub>𝔽</sub>, return *NaN*.
1. Return an implementation-approximated value representing the result of the inverse sine of ℝ(_n_).
1. Return an implementation-approximated Number value representing the result of the inverse sine of ℝ(_n_).
</emu-alg>
</emu-clause>

Expand All @@ -30960,7 +30960,7 @@ <h1>Math.asinh ( _x_ )</h1>
<emu-alg>
1. Let _n_ be ? ToNumber(_x_).
1. If _n_ is *NaN*, _n_ is *+0*<sub>𝔽</sub>, _n_ is *-0*<sub>𝔽</sub>, _n_ is *+&infin;*<sub>𝔽</sub>, or _n_ is *-&infin;*<sub>𝔽</sub>, return _n_.
1. Return an implementation-approximated value representing the result of the inverse hyperbolic sine of ℝ(_n_).
1. Return an implementation-approximated Number value representing the result of the inverse hyperbolic sine of ℝ(_n_).
</emu-alg>
</emu-clause>

Expand All @@ -30971,9 +30971,9 @@ <h1>Math.atan ( _x_ )</h1>
<emu-alg>
1. Let _n_ be ? ToNumber(_x_).
1. If _n_ is *NaN*, _n_ is *+0*<sub>𝔽</sub>, or _n_ is *-0*<sub>𝔽</sub>, return _n_.
1. If _n_ is *+&infin;*<sub>𝔽</sub>, return an implementation-approximated value representing &pi; / 2.
1. If _n_ is *-&infin;*<sub>𝔽</sub>, return an implementation-approximated value representing -&pi; / 2.
1. Return an implementation-approximated value representing the result of the inverse tangent of ℝ(_n_).
1. If _n_ is *+&infin;*<sub>𝔽</sub>, return an implementation-approximated Number value representing &pi; / 2.
1. If _n_ is *-&infin;*<sub>𝔽</sub>, return an implementation-approximated Number value representing -&pi; / 2.
1. Return an implementation-approximated Number value representing the result of the inverse tangent of ℝ(_n_).
</emu-alg>
</emu-clause>

Expand All @@ -30987,7 +30987,7 @@ <h1>Math.atanh ( _x_ )</h1>
1. If _n_ &gt; *1*<sub>𝔽</sub> or _n_ &lt; *-1*<sub>𝔽</sub>, return *NaN*.
1. If _n_ is *1*<sub>𝔽</sub>, return *+&infin;*<sub>𝔽</sub>.
1. If _n_ is *-1*<sub>𝔽</sub>, return *-&infin;*<sub>𝔽</sub>.
1. Return an implementation-approximated value representing the result of the inverse hyperbolic tangent of ℝ(_n_).
1. Return an implementation-approximated Number value representing the result of the inverse hyperbolic tangent of ℝ(_n_).
</emu-alg>
</emu-clause>

Expand All @@ -31000,30 +31000,30 @@ <h1>Math.atan2 ( _y_, _x_ )</h1>
1. Let _nx_ be ? ToNumber(_x_).
1. If _ny_ is *NaN* or _nx_ is *NaN*, return *NaN*.
1. If _ny_ is *+&infin;*<sub>𝔽</sub>, then
1. If _nx_ is *+&infin;*<sub>𝔽</sub>, return an implementation-approximated value representing &pi; / 4.
1. If _nx_ is *-&infin;*<sub>𝔽</sub>, return an implementation-approximated value representing 3&pi; / 4.
1. Return an implementation-approximated value representing &pi; / 2.
1. If _nx_ is *+&infin;*<sub>𝔽</sub>, return an implementation-approximated Number value representing &pi; / 4.
1. If _nx_ is *-&infin;*<sub>𝔽</sub>, return an implementation-approximated Number value representing 3&pi; / 4.
1. Return an implementation-approximated Number value representing &pi; / 2.
1. If _ny_ is *-&infin;*<sub>𝔽</sub>, then
1. If _nx_ is *+&infin;*<sub>𝔽</sub>, return an implementation-approximated value representing -&pi; / 4.
1. If _nx_ is *-&infin;*<sub>𝔽</sub>, return an implementation-approximated value representing -3&pi; / 4.
1. Return an implementation-approximated value representing -&pi; / 2.
1. If _nx_ is *+&infin;*<sub>𝔽</sub>, return an implementation-approximated Number value representing -&pi; / 4.
1. If _nx_ is *-&infin;*<sub>𝔽</sub>, return an implementation-approximated Number value representing -3&pi; / 4.
1. Return an implementation-approximated Number value representing -&pi; / 2.
1. If _ny_ is *+0*<sub>𝔽</sub>, then
1. If _nx_ &gt; *+0*<sub>𝔽</sub> or _nx_ is *+0*<sub>𝔽</sub>, return *+0*<sub>𝔽</sub>.
1. Return an implementation-approximated value representing &pi;.
1. Return an implementation-approximated Number value representing &pi;.
1. If _ny_ is *-0*<sub>𝔽</sub>, then
1. If _nx_ &gt; *+0*<sub>𝔽</sub> or _nx_ is *+0*<sub>𝔽</sub>, return *-0*<sub>𝔽</sub>.
1. Return an implementation-approximated value representing -&pi;.
1. Return an implementation-approximated Number value representing -&pi;.
1. Assert: _ny_ is finite and is neither *+0*<sub>𝔽</sub> nor *-0*<sub>𝔽</sub>.
1. If _ny_ &gt; *+0*<sub>𝔽</sub>, then
1. If _nx_ is *+&infin;*<sub>𝔽</sub>, return *+0*<sub>𝔽</sub>.
1. If _nx_ is *-&infin;*<sub>𝔽</sub>, return an implementation-approximated value representing &pi;.
1. If _nx_ is *+0*<sub>𝔽</sub> or _nx_ is *-0*<sub>𝔽</sub>, return an implementation-approximated value representing &pi; / 2.
1. If _nx_ is *-&infin;*<sub>𝔽</sub>, return an implementation-approximated Number value representing &pi;.
1. If _nx_ is *+0*<sub>𝔽</sub> or _nx_ is *-0*<sub>𝔽</sub>, return an implementation-approximated Number value representing &pi; / 2.
1. If _ny_ &lt; *+0*<sub>𝔽</sub>, then
1. If _nx_ is *+&infin;*<sub>𝔽</sub>, return *-0*<sub>𝔽</sub>.
1. If _nx_ is *-&infin;*<sub>𝔽</sub>, return an implementation-approximated value representing -&pi;.
1. If _nx_ is *+0*<sub>𝔽</sub> or _nx_ is *-0*<sub>𝔽</sub>, return an implementation-approximated value representing -&pi; / 2.
1. If _nx_ is *-&infin;*<sub>𝔽</sub>, return an implementation-approximated Number value representing -&pi;.
1. If _nx_ is *+0*<sub>𝔽</sub> or _nx_ is *-0*<sub>𝔽</sub>, return an implementation-approximated Number value representing -&pi; / 2.
1. Assert: _nx_ is finite and is neither *+0*<sub>𝔽</sub> nor *-0*<sub>𝔽</sub>.
1. Return an implementation-approximated value representing the result of the inverse tangent of the quotient ℝ(_ny_) / ℝ(_nx_).
1. Return an implementation-approximated Number value representing the result of the inverse tangent of the quotient ℝ(_ny_) / ℝ(_nx_).
</emu-alg>
</emu-clause>

Expand All @@ -31034,7 +31034,7 @@ <h1>Math.cbrt ( _x_ )</h1>
<emu-alg>
1. Let _n_ be ? ToNumber(_x_).
1. If _n_ is *NaN*, _n_ is *+0*<sub>𝔽</sub>, _n_ is *-0*<sub>𝔽</sub>, _n_ is *+&infin;*<sub>𝔽</sub>, or _n_ is *-&infin;*<sub>𝔽</sub>, return _n_.
1. Return an implementation-approximated value representing the result of the cube root of ℝ(_n_).
1. Return an implementation-approximated Number value representing the result of the cube root of ℝ(_n_).
</emu-alg>
</emu-clause>

Expand Down Expand Up @@ -31075,7 +31075,7 @@ <h1>Math.cos ( _x_ )</h1>
1. Let _n_ be ? ToNumber(_x_).
1. If _n_ is *NaN*, _n_ is *+&infin;*<sub>𝔽</sub>, or _n_ is *-&infin;*<sub>𝔽</sub>, return *NaN*.
1. If _n_ is *+0*<sub>𝔽</sub> or _n_ is *-0*<sub>𝔽</sub>, return *1*<sub>𝔽</sub>.
1. Return an implementation-approximated value representing the result of the cosine of ℝ(_n_).
1. Return an implementation-approximated Number value representing the result of the cosine of ℝ(_n_).
</emu-alg>
</emu-clause>

Expand All @@ -31088,7 +31088,7 @@ <h1>Math.cosh ( _x_ )</h1>
1. If _n_ is *NaN*, return *NaN*.
1. If _n_ is *+&infin;*<sub>𝔽</sub> or _n_ is *-&infin;*<sub>𝔽</sub>, return *+&infin;*<sub>𝔽</sub>.
1. If _n_ is *+0*<sub>𝔽</sub> or _n_ is *-0*<sub>𝔽</sub>, return *1*<sub>𝔽</sub>.
1. Return an implementation-approximated value representing the result of the hyperbolic cosine of ℝ(_n_).
1. Return an implementation-approximated Number value representing the result of the hyperbolic cosine of ℝ(_n_).
</emu-alg>
<emu-note>
<p>The value of `Math.cosh(x)` is the same as the value of `(Math.exp(x) + Math.exp(-x)) / 2`.</p>
Expand All @@ -31104,7 +31104,7 @@ <h1>Math.exp ( _x_ )</h1>
1. If _n_ is *NaN* or _n_ is *+&infin;*<sub>𝔽</sub>, return _n_.
1. If _n_ is *+0*<sub>𝔽</sub> or _n_ is *-0*<sub>𝔽</sub>, return *1*<sub>𝔽</sub>.
1. If _n_ is *-&infin;*<sub>𝔽</sub>, return *+0*<sub>𝔽</sub>.
1. Return an implementation-approximated value representing the result of the exponential function of ℝ(_n_).
1. Return an implementation-approximated Number value representing the result of the exponential function of ℝ(_n_).
</emu-alg>
</emu-clause>

Expand All @@ -31116,7 +31116,7 @@ <h1>Math.expm1 ( _x_ )</h1>
1. Let _n_ be ? ToNumber(_x_).
1. If _n_ is *NaN*, _n_ is *+0*<sub>𝔽</sub>, _n_ is *-0*<sub>𝔽</sub>, or _n_ is *+&infin;*<sub>𝔽</sub>, return _n_.
1. If _n_ is *-&infin;*<sub>𝔽</sub>, return *-1*<sub>𝔽</sub>.
1. Return an implementation-approximated value representing the result of subtracting 1 from the exponential function of ℝ(_n_).
1. Return an implementation-approximated Number value representing the result of subtracting 1 from the exponential function of ℝ(_n_).
</emu-alg>
</emu-clause>

Expand Down Expand Up @@ -31165,7 +31165,7 @@ <h1>Math.hypot ( ..._args_ )</h1>
1. If _number_ is *NaN*, return *NaN*.
1. If _number_ is neither *+0*<sub>𝔽</sub> nor *-0*<sub>𝔽</sub>, set _onlyZero_ to *false*.
1. If _onlyZero_ is *true*, return *+0*<sub>𝔽</sub>.
1. Return an implementation-approximated value representing the square root of the sum of squares of the mathematical values of the elements of _coerced_.
1. Return an implementation-approximated Number value representing the square root of the sum of squares of the mathematical values of the elements of _coerced_.
</emu-alg>
<p>The *"length"* property of the `hypot` method is *2*<sub>𝔽</sub>.</p>
<emu-note>
Expand Down Expand Up @@ -31194,7 +31194,7 @@ <h1>Math.log ( _x_ )</h1>
1. If _n_ is *1*<sub>𝔽</sub>, return *+0*<sub>𝔽</sub>.
1. If _n_ is *+0*<sub>𝔽</sub> or _n_ is *-0*<sub>𝔽</sub>, return *-&infin;*<sub>𝔽</sub>.
1. If _n_ &lt; *+0*<sub>𝔽</sub>, return *NaN*.
1. Return an implementation-approximated value representing the result of the natural logarithm of ℝ(_n_).
1. Return an implementation-approximated Number value representing the result of the natural logarithm of ℝ(_n_).
</emu-alg>
</emu-clause>

Expand All @@ -31207,7 +31207,7 @@ <h1>Math.log1p ( _x_ )</h1>
1. If _n_ is *NaN*, _n_ is *+0*<sub>𝔽</sub>, _n_ is *-0*<sub>𝔽</sub>, or _n_ is *+&infin;*<sub>𝔽</sub>, return _n_.
1. If _n_ is *-1*<sub>𝔽</sub>, return *-&infin;*<sub>𝔽</sub>.
1. If _n_ &lt; *-1*<sub>𝔽</sub>, return *NaN*.
1. Return an implementation-approximated value representing the result of the natural logarithm of 1 + ℝ(_n_).
1. Return an implementation-approximated Number value representing the result of the natural logarithm of 1 + ℝ(_n_).
</emu-alg>
</emu-clause>

Expand All @@ -31221,7 +31221,7 @@ <h1>Math.log10 ( _x_ )</h1>
1. If _n_ is *1*<sub>𝔽</sub>, return *+0*<sub>𝔽</sub>.
1. If _n_ is *+0*<sub>𝔽</sub> or _n_ is *-0*<sub>𝔽</sub>, return *-&infin;*<sub>𝔽</sub>.
1. If _n_ &lt; *+0*<sub>𝔽</sub>, return *NaN*.
1. Return an implementation-approximated value representing the result of the base 10 logarithm of ℝ(_n_).
1. Return an implementation-approximated Number value representing the result of the base 10 logarithm of ℝ(_n_).
</emu-alg>
</emu-clause>

Expand All @@ -31235,7 +31235,7 @@ <h1>Math.log2 ( _x_ )</h1>
1. If _n_ is *1*<sub>𝔽</sub>, return *+0*<sub>𝔽</sub>.
1. If _n_ is *+0*<sub>𝔽</sub> or _n_ is *-0*<sub>𝔽</sub>, return *-&infin;*<sub>𝔽</sub>.
1. If _n_ &lt; *+0*<sub>𝔽</sub>, return *NaN*.
1. Return an implementation-approximated value representing the result of the base 2 logarithm of ℝ(_n_).
1. Return an implementation-approximated Number value representing the result of the base 2 logarithm of ℝ(_n_).
</emu-alg>
</emu-clause>

Expand Down Expand Up @@ -31338,7 +31338,7 @@ <h1>Math.sin ( _x_ )</h1>
1. Let _n_ be ? ToNumber(_x_).
1. If _n_ is *NaN*, _n_ is *+0*<sub>𝔽</sub>, or _n_ is *-0*<sub>𝔽</sub>, return _n_.
1. If _n_ is *+&infin;*<sub>𝔽</sub> or _n_ is *-&infin;*<sub>𝔽</sub>, return *NaN*.
1. Return an implementation-approximated value representing the result of the sine of ℝ(_n_).
1. Return an implementation-approximated Number value representing the result of the sine of ℝ(_n_).
</emu-alg>
</emu-clause>

Expand All @@ -31349,7 +31349,7 @@ <h1>Math.sinh ( _x_ )</h1>
<emu-alg>
1. Let _n_ be ? ToNumber(_x_).
1. If _n_ is *NaN*, _n_ is *+0*<sub>𝔽</sub>, _n_ is *-0*<sub>𝔽</sub>, _n_ is *+&infin;*<sub>𝔽</sub>, or _n_ is *-&infin;*<sub>𝔽</sub>, return _n_.
1. Return an implementation-approximated value representing the result of the hyperbolic sine of ℝ(_n_).
1. Return an implementation-approximated Number value representing the result of the hyperbolic sine of ℝ(_n_).
</emu-alg>
<emu-note>
<p>The value of `Math.sinh(x)` is the same as the value of `(Math.exp(x) - Math.exp(-x)) / 2`.</p>
Expand All @@ -31364,7 +31364,7 @@ <h1>Math.sqrt ( _x_ )</h1>
1. Let _n_ be ? ToNumber(_x_).
1. If _n_ is *NaN*, _n_ is *+0*<sub>𝔽</sub>, _n_ is *-0*<sub>𝔽</sub>, or _n_ is *+&infin;*<sub>𝔽</sub>, return _n_.
1. If _n_ &lt; *+0*<sub>𝔽</sub>, return *NaN*.
1. Return an implementation-approximated value representing the result of the square root of ℝ(_n_).
1. Return an implementation-approximated Number value representing the result of the square root of ℝ(_n_).
</emu-alg>
</emu-clause>

Expand All @@ -31376,7 +31376,7 @@ <h1>Math.tan ( _x_ )</h1>
1. Let _n_ be ? ToNumber(_x_).
1. If _n_ is *NaN*, _n_ is *+0*<sub>𝔽</sub>, or _n_ is *-0*<sub>𝔽</sub>, return _n_.
1. If _n_ is *+&infin;*<sub>𝔽</sub>, or _n_ is *-&infin;*<sub>𝔽</sub>, return *NaN*.
1. Return an implementation-approximated value representing the result of the tangent of ℝ(_n_).
1. Return an implementation-approximated Number value representing the result of the tangent of ℝ(_n_).
</emu-alg>
</emu-clause>

Expand All @@ -31389,7 +31389,7 @@ <h1>Math.tanh ( _x_ )</h1>
1. If _n_ is *NaN*, _n_ is *+0*<sub>𝔽</sub>, or _n_ is *-0*<sub>𝔽</sub>, return _n_.
1. If _n_ is *+&infin;*<sub>𝔽</sub>, return *1*<sub>𝔽</sub>.
1. If _n_ is *-&infin;*<sub>𝔽</sub>, return *-1*<sub>𝔽</sub>.
1. Return an implementation-approximated value representing the result of the hyperbolic tangent of ℝ(_n_).
1. Return an implementation-approximated Number value representing the result of the hyperbolic tangent of ℝ(_n_).
</emu-alg>
<emu-note>
<p>The value of `Math.tanh(x)` is the same as the value of `(Math.exp(x) - Math.exp(-x)) / (Math.exp(x) + Math.exp(-x))`.</p>
Expand Down

0 comments on commit 1102b66

Please sign in to comment.