diff --git a/spec.html b/spec.html index 64c095655b1..94d406f10fd 100644 --- a/spec.html +++ b/spec.html @@ -1963,17 +1963,11 @@

The Number Type

There are two other special values, called *positive Infinity* and *negative Infinity*. For brevity, these values are also referred to for expository purposes by the symbols *+∞*𝔽 and *-∞*𝔽, respectively. (Note that these two infinite Number values are produced by the program expressions `+Infinity` (or simply `Infinity`) and `-Infinity`.)

Each of the other 18,437,736,874,454,810,624 (that is, 264 - 253) values is a finite Number. Half of these are positive numbers and half are negative numbers; for every positive finite Number, there is a corresponding negative Number having the same magnitude.

Note that there is both a *positive zero* and a *negative zero*. For brevity, these values are also referred to for expository purposes by the symbols *+0*𝔽 and *-0*𝔽, respectively. (Note that these two different zero Number values are produced by the program expressions `+0` (or simply `0`) and `-0`.)

-

The 18,437,736,874,454,810,622 (that is, 264 - 253 - 2) finite non-zero values are of two kinds:

-

18,428,729,675,200,069,632 (that is, 264 - 254) of them are normalized, having the form

-
- _s_ Γ— _m_ Γ— 2_e_ -
-

where _s_ is 1 or -1, _m_ is an integer in the interval from 252 (inclusive) to 253 (exclusive), and _e_ is an integer in the inclusive interval from -1074 to 971.

-

The remaining 9,007,199,254,740,990 (that is, 253 - 2) values are denormalized, having the form

-
- _s_ Γ— _m_ Γ— 2_e_ -
-

where _s_ is 1 or -1, _m_ is an integer in the interval from 0 (exclusive) to 252 (exclusive), and _e_ is -1074.

+

The 18,437,736,874,454,810,622 (that is, 264 - 253 - 2) non-zero finite Numbers are partitioned into two groups, based on integers _m_ and _e_ in their corresponding mathematical value _s_ Γ— _m_ Γ— 2_e_, where _s_ is 1 or -1:

+

Note that all the positive and negative integers whose magnitude is no greater than 253 are representable in the Number type. The integer 0 has two representations in the Number type: *+0*𝔽 and *-0*𝔽.

A finite Number has an odd significand if it is non-zero and the integer _m_ used to express it (in one of the two forms shown above) is odd. Otherwise, it has an even significand.

In this specification, the phrase β€œthe Number value for _x_” where _x_ represents an exact real mathematical quantity (which might even be an irrational number such as Ο€) means a Number value chosen in the following manner. Consider the set consisting of the union of all finite Numbers except *-0*𝔽 with two additional values that are not representable in the Number type, namely 21024 (which is +1 Γ— 253 Γ— 2971) and -21024 (which is -1 Γ— 253 Γ— 2971). Choose the member of this set that is closest in value to _x_. If two values of the set are equally close, then the one with an even significand is chosen; for this purpose, the two extra values 21024 and -21024 are considered to have even significands. Finally, if 21024 was chosen, replace it with *+∞*𝔽; if -21024 was chosen, replace it with *-∞*𝔽; if *+0*𝔽 was chosen, replace it with *-0*𝔽 if and only if _x_ < 0; any other chosen value is used unchanged. The result is the Number value for _x_. (This procedure corresponds exactly to the behaviour of the IEEE 754-2019 roundTiesToEven mode.)

@@ -2041,7 +2035,7 @@

1. Return *+0*𝔽. 1. If _exponent_ is an odd integral Number, return *-∞*𝔽. 1. Return *+∞*𝔽. - 1. Assert: _base_ is a finite Number and is neither *+0*𝔽 nor *-0*𝔽. + 1. Assert: _base_ is a non-zero finite Number. 1. If _exponent_ is *+∞*𝔽, then 1. If abs(ℝ(_base_)) > 1, return *+∞*𝔽. 1. If abs(ℝ(_base_)) = 1, return *NaN*. @@ -2050,7 +2044,7 @@

1. If abs(ℝ(_base_)) > 1, return *+0*𝔽. 1. If abs(ℝ(_base_)) = 1, return *NaN*. 1. Return *+∞*𝔽. - 1. Assert: _exponent_ is a finite Number and is neither *+0*𝔽 nor *-0*𝔽. + 1. Assert: _exponent_ is a non-zero finite Number. 1. If _base_ < *-0*𝔽 and _exponent_ is not an integral Number, return *NaN*. 1. Return an implementation-approximated Number value representing the result of raising ℝ(_base_) to the ℝ(_exponent_) power. @@ -2147,8 +2141,7 @@

1. If _denominator_ is either *+∞*𝔽 or *-∞*𝔽, return _numerator_. 1. If _denominator_ is either *+0*𝔽 or *-0*𝔽, return *NaN*. 1. If _numerator_ is either *+0*𝔽 or *-0*𝔽, return _numerator_. - 1. Assert: _numerator_ is a finite Number and is neither *+0*𝔽 nor *-0*𝔽. - 1. Assert: _denominator_ is a finite Number and is neither *+0*𝔽 nor *-0*𝔽. + 1. Assert: _numerator_ and _denominator_ are non-zero finite Numbers. 1. Let _quotient_ be ℝ(_numerator_) / ℝ(_denominator_). 1. Let _truncatedQuotient_ be truncate(_quotient_). 1. Let _remainder_ be ℝ(_numerator_) - (ℝ(_denominator_) Γ— _truncatedQuotient_). @@ -33463,7 +33456,7 @@

Math.asinh ( _x_ )

It performs the following steps when called:

1. Let _n_ be ? ToNumber(_x_). - 1. If _n_ is not a finite Number or _n_ is either *+0*𝔽 or *-0*𝔽, return _n_. + 1. If _n_ is not a non-zero finite Number, return _n_. 1. Return an implementation-approximated Number value representing the inverse hyperbolic sine of ℝ(_n_). @@ -33517,7 +33510,7 @@

Math.atan2 ( _y_, _x_ )

1. If _ny_ is *-0*𝔽, then 1. If _nx_ > *+0*𝔽 or _nx_ is *+0*𝔽, return *-0*𝔽. 1. Return an implementation-approximated Number value representing -Ο€. - 1. Assert: _ny_ is a finite Number and is neither *+0*𝔽 nor *-0*𝔽. + 1. Assert: _ny_ is a non-zero finite Number. 1. If _ny_ > *+0*𝔽, then 1. If _nx_ is *+∞*𝔽, return *+0*𝔽. 1. If _nx_ is *-∞*𝔽, return an implementation-approximated Number value representing Ο€. @@ -33526,7 +33519,7 @@

Math.atan2 ( _y_, _x_ )

1. If _nx_ is *+∞*𝔽, return *-0*𝔽. 1. If _nx_ is *-∞*𝔽, return an implementation-approximated Number value representing -Ο€. 1. If _nx_ is either *+0*𝔽 or *-0*𝔽, return an implementation-approximated Number value representing -Ο€ / 2. - 1. Assert: _nx_ is a finite Number and is neither *+0*𝔽 nor *-0*𝔽. + 1. Assert: _nx_ is a non-zero finite Number. 1. Let _result_ be the inverse tangent of abs(ℝ(_ny_) / ℝ(_nx_)). 1. If _nx_ < *-0*𝔽, then 1. If _ny_ > *+0*𝔽, set _result_ to Ο€ - _result_. @@ -33543,7 +33536,7 @@

Math.cbrt ( _x_ )

It performs the following steps when called:

1. Let _n_ be ? ToNumber(_x_). - 1. If _n_ is not a finite Number or _n_ is either *+0*𝔽 or *-0*𝔽, return _n_. + 1. If _n_ is not a non-zero finite Number, return _n_. 1. Return an implementation-approximated Number value representing the cube root of ℝ(_n_). @@ -33554,7 +33547,7 @@

Math.ceil ( _x_ )

It performs the following steps when called:

1. Let _n_ be ? ToNumber(_x_). - 1. If _n_ is not a finite Number or _n_ is either *+0*𝔽 or *-0*𝔽, return _n_. + 1. If _n_ is not a non-zero finite Number, return _n_. 1. If _n_ < *-0*𝔽 and _n_ > *-1*𝔽, return *-0*𝔽. 1. If _n_ is an integral Number, return _n_. 1. Return the smallest (closest to -∞) integral Number value that is not less than _n_. @@ -33637,7 +33630,7 @@

Math.floor ( _x_ )

It performs the following steps when called:

1. Let _n_ be ? ToNumber(_x_). - 1. If _n_ is not a finite Number or _n_ is either *+0*𝔽 or *-0*𝔽, return _n_. + 1. If _n_ is not a non-zero finite Number, return _n_. 1. If _n_ < *1*𝔽 and _n_ > *+0*𝔽, return *+0*𝔽. 1. If _n_ is an integral Number, return _n_. 1. Return the greatest (closest to +∞) integral Number value that is not greater than _n_. @@ -33877,7 +33870,7 @@

Math.sinh ( _x_ )

It performs the following steps when called:

1. Let _n_ be ? ToNumber(_x_). - 1. If _n_ is not a finite Number or _n_ is either *+0*𝔽 or *-0*𝔽, return _n_. + 1. If _n_ is not a non-zero finite Number, return _n_. 1. Return an implementation-approximated Number value representing the hyperbolic sine of ℝ(_n_). @@ -33977,7 +33970,7 @@

Math.trunc ( _x_ )

It performs the following steps when called:

1. Let _n_ be ? ToNumber(_x_). - 1. If _n_ is not a finite Number or _n_ is either *+0*𝔽 or *-0*𝔽, return _n_. + 1. If _n_ is not a non-zero finite Number, return _n_. 1. If _n_ < *1*𝔽 and _n_ > *+0*𝔽, return *+0*𝔽. 1. If _n_ < *-0*𝔽 and _n_ > *-1*𝔽, return *-0*𝔽. 1. Return the integral Number nearest _n_ in the direction of *+0*𝔽.