diff --git a/index.html b/index.html index 755edf9..a525efc 100644 --- a/index.html +++ b/index.html @@ -3231,7 +3231,7 @@

Stage 1 Draft / September 24, 2024

Decimal

+

Stage 1 Draft / September 26, 2024

Decimal

Introduction

@@ -3349,7 +3349,7 @@

1.1 Abstract Operations

1.1.1 RoundToDecimal128Domain ( v [ , roundingMode ] )

The abstract operation RoundToDecimal128Domain takes argument v (a mathematical value) and optional argument roundingMode (a Decimal128 rounding mode) and returns +∞𝔻, -∞𝔻, +0𝔻, −0𝔻, or a mathematical value. It computes the closest approximation to a given mathematical value, rounded according to the given rounding mode, that is available within the limits of Decimal128. It performs the following steps when called:

-
  1. If v = 0, return +0𝔻.
  2. If v < 0, then
    1. Let reverseRoundingMode be roundingMode.
    2. If roundingMode is "floor", set reverseRoundingMode to "ceil".
    3. If roundingMode is "ceil", set reverseRoundingMode to "floor".
    4. Let d be RoundToDecimal128Domain(–v, reverseRoundingMode).
    5. If d is +∞𝔻, return –∞𝔻.
    6. If d is +0𝔻, return −0𝔻.
    7. Assert: d is a mathematical value.
    8. Return –d.
  3. Let e be the unique integer such that 10ev < 10e+1.
  4. Let te be e − 33.
  5. If te < –6176, set te to –6176.
  6. Let m be v × 10te.
  7. Let rounded be ApplyRoundingModeToPositive(m, roundingMode).
  8. If rounded = 1034, then
    1. Set te to te + 1.
    2. Set rounded = to 1033.
  9. If te > 6111, return +∞𝔻.
  10. If rounded = 0, return +0𝔻.
  11. Return rounded × 10te.
+
  1. If v = 0, return +0𝔻.
  2. If v < 0, then
    1. Let reverseRoundingMode be roundingMode.
    2. If roundingMode is "floor", set reverseRoundingMode to "ceil".
    3. If roundingMode is "ceil", set reverseRoundingMode to "floor".
    4. Let d be RoundToDecimal128Domain(–v, reverseRoundingMode).
    5. If d is +∞𝔻, return –∞𝔻.
    6. If d is +0𝔻, return −0𝔻.
    7. Assert: d is a mathematical value.
    8. Return –d.
  3. Let e be the unique integer such that 10ev < 10e+1.
  4. Let te be e − 33.
  5. If te < –6176, set te to –6176.
  6. Let m be v × 10te.
  7. Let rounded be ApplyRoundingModeToPositive(m, roundingMode).
  8. If rounded = 1034, then
    1. Set te to te + 1.
    2. Set rounded to 1033.
  9. If te > 6111, return +∞𝔻.
  10. If rounded = 0, return +0𝔻.
  11. Return rounded × 10te.

1.1.1.1 ApplyRoundingModeToPositive ( m, roundingMode )