Skip to content

Commit 6ec1608

Browse files
ptomatoMs2ger
authored andcommitted
Editorial: Drop "integral part of" language
The term "integral part of" isn't defined anywhere. Instead, we have an abstract operation for this already. Closes: #1890
1 parent 5b1b783 commit 6ec1608

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

spec/abstractops.html

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -636,10 +636,17 @@ <h1>FormatSecondsStringPart ( _second_, _millisecond_, _microsecond_, _nanosecon
636636
</emu-alg>
637637
</emu-clause>
638638

639-
<emu-clause id="sec-temporal-roundtowardszero" aoid="RoundTowardsZero">
640-
<h1>RoundTowardsZero ( _x_ )</h1>
639+
<emu-clause id="sec-temporal-roundtowardszero" type="abstract operation">
640+
<h1>
641+
RoundTowardsZero (
642+
_x_: a mathematical value,
643+
): an integer
644+
</h1>
645+
<dl class="header">
646+
<dt>description</dt>
647+
<dd>The returned integer is the integral part of _x_, with any fractional part removed.</dd>
648+
</dl>
641649
<emu-alg>
642-
1. Assert: _x_ is a mathematical value.
643650
1. Return the mathematical value that is the same sign as _x_ and whose magnitude is floor(abs(_x_)).
644651
</emu-alg>
645652
</emu-clause>
@@ -673,7 +680,7 @@ <h1>RoundNumberToIncrement ( _x_, _increment_, _roundingMode_ )</h1>
673680
1. Else if _roundingMode_ is *"floor"*, then
674681
1. Let _rounded_ be floor(_quotient_).
675682
1. Else if _roundingMode_ is *"trunc"*, then
676-
1. Let _rounded_ be the integral part of _quotient_, removing any fractional digits.
683+
1. Let _rounded_ be RoundTowardsZero(_quotient_).
677684
1. Else,
678685
1. Let _rounded_ be ! RoundHalfAwayFromZero(_quotient_).
679686
1. Return _rounded_ × _increment_.

spec/duration.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,11 +1807,11 @@ <h1>
18071807
</dl>
18081808
<emu-alg>
18091809
1. Let _sign_ be ! DurationSign(_years_, _months_, _weeks_, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_).
1810-
1. Set _microseconds_ to _microseconds_ + the integral part of _nanoseconds_ / 1000.
1810+
1. Set _microseconds_ to _microseconds_ + RoundTowardsZero(_nanoseconds_ / 1000).
18111811
1. Set _nanoseconds_ to remainder(_nanoseconds_, 1000).
1812-
1. Set _milliseconds_ to _milliseconds_ + the integral part of _microseconds_ / 1000.
1812+
1. Set _milliseconds_ to _milliseconds_ + RoundTowardsZero(_microseconds_ / 1000).
18131813
1. Set _microseconds_ to remainder(_microseconds_, 1000).
1814-
1. Set _seconds_ to _seconds_ + the integral part of _milliseconds_ / 1000.
1814+
1. Set _seconds_ to _seconds_ + RoundTowardsZero(_milliseconds_ / 1000).
18151815
1. Set _milliseconds_ to remainder(_milliseconds_, 1000).
18161816
1. Let _datePart_ be *""*.
18171817
1. If _years_ is not 0, then

spec/zoneddatetime.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,7 @@ <h1>
13641364
1. If _nanoseconds_ &lt; 0, let _sign_ be −1; else, let _sign_ be 1.
13651365
1. If Type(_relativeTo_) is not Object or _relativeTo_ does not have an [[InitializedTemporalZonedDateTime]] internal slot, then
13661366
1. Return the Record {
1367-
[[Days]]: the integral part of _nanoseconds_ / _dayLengthNs_,
1367+
[[Days]]: RoundTowardsZero(_nanoseconds_ / _dayLengthNs_),
13681368
[[Nanoseconds]]: (abs(_nanoseconds_) modulo _dayLengthNs_) × _sign_,
13691369
[[DayLength]]: _dayLengthNs_
13701370
}.

0 commit comments

Comments
 (0)