From 191d50468efc3d41153d67b810dd7f25bdf0a531 Mon Sep 17 00:00:00 2001 From: Jesse Alama Date: Mon, 19 Jan 2026 16:01:48 +0100 Subject: [PATCH] Remove Decimal.Amount, refocus on exact arithmetic --- README.md | 52 +++++---------------- index.html | 133 +++++++++++++++++------------------------------------ spec.emu | 95 -------------------------------------- 3 files changed, 54 insertions(+), 226 deletions(-) diff --git a/README.md b/README.md index 7e42a163..b3d2ca9b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Ecma TC39 JavaScript Decimal proposal -The TC39 Decimal proposal aims to add functionality to JavaScript to represent base-10 decimal numbers. +The TC39 Decimal proposal aims to add exact decimal arithmetic to JavaScript, eliminating the rounding errors that occur with binary floating-point numbers. The champions welcome your participation in discussing the design space in the issues linked above. **We are seeking input for your needs around JavaScript decimal in [this survey](https://forms.gle/A2YaTr3Tn1o3D7hdA).** @@ -25,14 +25,13 @@ As currently defined in JavaScript, Numbers are 64-bit binary floating-point num The goal of the Decimal proposal is to add support to the JavaScript standard library for decimal numbers in a way that provides good ergonomics and functionality. JS programmers should feel comfortable using decimal numbers, when those are appropriate. Being built-in to JavaScript means that we will get optimizable, well-maintained implementations that don’t require transmitting, storing, or parsing and jit-optimizing every additional JavaScript code. -### Primary use case: Representing human-readable decimal values such as money +### Primary use case: Exact decimal arithmetic for financial calculations Many currencies tend to be expressed with decimal quantities. Although it’s possible to represent money as integer “cents” (multiply all quantities by 100), this approach runs into a couple of issues: - There’s a persistent mismatch between the way humans think about money and the way it’s manipulated in the program, causing mental overhead for the programmer aware of the issue. - Some programmers may not even be aware of this mismatch. This opens the door to rounding errors whose source is unknown. If calculations start to get more involved, the chance of error increases. -- Different currencies use different numbers of decimal positions which is easy to get confused; the hack of working with quantities that are implicitly multiplied by 100 may not work when working with multiple currencies. For instance, it’s not correct to assume that all currencies have two decimal places, or that the only exception is JPY (Japanese yen); making such assumptions will make it hard to internationalize code to new countries. For this reason, it’s ideal if the number of decimal places is part of the data type. -- In various contexts (e.g., presenting a quantity to the end user), the decimal point needs to be brought back in somehow. For example, `Intl.NumberFormat` only knows how to format JS Numbers, and can’t deal with an integer-and-exponent pair. +- Different currencies use different numbers of decimal positions which is easy to get confused; the hack of working with quantities that are implicitly multiplied by 100 may not work when working with multiple currencies. For instance, it's not correct to assume that all currencies have two decimal places, or that the only exception is JPY (Japanese yen); making such assumptions will make it hard to internationalize code to new countries. - Sometimes, fractional cents need to be represented too (e.g., as precise prices that occur, for instance, in stock trading or currency conversion). #### Sample code @@ -72,30 +71,6 @@ let amountInEur = exchangeRateUsdToEur.multiply(amountInUsd); console.log(amountInEur.round(2).toString()); ``` -Here's the same example, this time using `Decimal.Amount` -and `Intl.NumberFormat` to properly handle currency: - -```js -let exchangeRateEurToUsd = new Decimal("1.09"); -let amountInUsd = new Decimal("450.27"); -let exchangeRateUsdToEur = new Decimal(1).divide(exchangeRateEurToUsd); -let amountInEur = exchangeRateUsdToEur.multiply(amountInUsd); -let opts = { style: "currency", currency: "EUR" }; -let formatter = new Intl.NumberFormat("en-US", opts); -let amount = Decimal.Amount(amountInEur).with({ fractionDigits: 2 }); -console.log(formatter.format(amount)); -``` - -##### Format decimals with Intl.NumberFormat - -We propose a `Decimal.Amount` object to store a Decimal value together with precision information. This is especially useful in formatting Decimal values, especially in internationalization and localization contexts. - -```js -let a = Decimal.Amount.from("1.90").with({ fractionDigits: 4 }); -const formatter = new Intl.NumberFormat("de-DE"); -formatter.format(a); // "1,9000" -``` - #### Why use JavaScript for this case? Historically, JavaScript may not have been considered a language where exact decimal numbers are even exactly representable, with the understanding that doing calculations is bound to propagate any initial rounding errors when numbers were created. In some application architectures, JS only deals with a string representing a human-readable decimal quantity (e.g, `"1.25"`), and never does calculations or conversions. However, several trends push towards JS’s deeper involvement in with decimal quantities: @@ -119,7 +94,6 @@ This use case implies the following goals: - Avoid unintentional rounding that causes user-visible errors - Basic mathematical functions such as addition, subtraction, multiplication, and division - Sufficient precision for typical money and other human-readable quantities, including cryptocurrency (where many decimal digits are routinely needed) -- Conversion to a string in a locale-sensitive manner - Sufficient ergonomics to enable correct usage - Be implementable with adequate performance/memory usage for applications - (Please file an issue to mention more requirements) @@ -145,11 +119,9 @@ This use case implies the following goals: Interaction with other systems brings the following requirements: - Ability to round-trip decimal quantities from other systems -- Serialization and deserialization in standard decimal formats, e.g., IEEE 754’s multiple formats +- Serialization and deserialization in standard decimal formats, e.g., IEEE 754's multiple formats - Precision sufficient for the applications on the other side -The `Decimal.Amount` class also helps with data exchange, in cases where one needs to preserve all digits—including any trailing zeroes—in a digit string coming over the wire. That is, the `Decimal.Amount` class contains more information that a mathematical value. - #### Sample code ##### Configure a database adapter to use JS-native decimals @@ -241,8 +213,6 @@ Based on feedback from JS developers, engine implementors, and the members of th We will use the **Decimal128** data model for JavaScript decimals. Decimal128 is not a new standard; it was added to the IEEE 754 floating-point arithmetic standard in 2008 (and is present in the 2019 edition of IEEE 754, which JS normatively depends upon). It represents the culmination of decades of research on decimal floating-point numbers. Values in the Decimal128 universe take up 128 bits. In this representation, up to 34 significant digits (that is, decimal digits) can be stored, with an exponent (power of ten) of +/- 6143. -In addition to proposing a new `Decimal` class, we propose a `Decimal.Amount` class for storing a Decimal number together with a precision. The `Decimal.Amount` class is important mainly for string formatting purposes, where one desires to have a notion of a number that “knows” how precise it is. We do not intend to support arithmetic on `Decimal.Amount` values, the thinking being that `Decimal` already supports arithmetic. - ### Known alternatives #### Unlimited precision decimals (AKA "BigDecimal") @@ -293,9 +263,7 @@ Decimal is based on IEEE 754-2019 Decimal128, which is a standard for base-10 de - a single NaN value--distinct from the built-in `NaN` of JS. The difference between quiet and singaling NaNs will be collapsed into a single (quiet) Decimal NaN. - positive and negative infinity will be available, though, as with `NaN`, they are distinct from JS's built-in `Infinity` and `-Infinity`. -Decimal canonicalizes when converting to strings and after performing arithmetic operations. This means that Decimals do not expose information about trailing zeroes. Thus, "1.20" is valid syntax, but there is no way to distinguish 1.20 from 1.2. This is an important omission from the capabilities defined by IEEE 754 Decimal128. The `Decimal.Amount` class can be used to store an exact decimal value together with precision (number of significant digits), which can be used to track all digits of a number, including any trailing zeroes (which Decimal canonicalizes away). - -The `Decimal.Amount` class will not support arithmetic or comparisons. Such operations should be delegated to the underlying Decimal value wrapped by a `Decimal.Amount`. +Decimal canonicalizes when converting to strings and after performing arithmetic operations. This means that Decimals do not expose information about trailing zeroes. Thus, "1.20" is valid syntax, but there is no way to distinguish 1.20 from 1.2. This is an important omission from the capabilities defined by IEEE 754 Decimal128. ### Operator semantics @@ -336,10 +304,8 @@ Decimal objects can be constructed from Numbers, Strings, and BigInts. Similarly - `toFixed()` is similar to Number's `toFixed()` - `toPrecison()` is similar to Number's `toPrecision()` - `toExponential()` is similar to Number's `toExponential()` -- `Intl.NumberFormat.prototype.format` should transparently support Decimal ([#15](https://github.com/tc39/proposal-decimal/issues/15)), which will be handled via `Decimal.Amount` objects -- `Intl.PluralRules.prototype.select` should similarly support Decimal, in that it will support `Decimal.Amount` objects - -In addition, the `Decimal.Amount` object will provide a `toString` method, which will render its underlying Decimal value according to its underlying precision. +- `Intl.NumberFormat.prototype.format` will support Decimal values directly ([#15](https://github.com/tc39/proposal-decimal/issues/15)) +- `Intl.PluralRules.prototype.select` will similarly support Decimal values ## Past discussions in TC39 plenaries @@ -385,6 +351,10 @@ In our discussions we have consistently emphasized the need for basic arithmetic These can be more straightforwardly added in a v2 of Decimal. Based on developer feedback we have already received, we sense that there is relatively little need for these functions. But it is not unreasonable to expect that such feedback will arrive once a v1 of Decimal is widely used. +### Precision metadata for formatting + +A future addition could be a type that pairs a Decimal value with precision metadata (e.g., number of fractional digits). This would be useful for formatting scenarios where trailing zeroes matter, such as displaying currency amounts. Such functionality may be addressed by the TC39 [Amount proposal](https://github.com/tc39/proposal-amount); see [proposal-amount#75](https://github.com/tc39/proposal-amount/issues/75) for discussion. + ## FAQ ### What about rational numbers? diff --git a/index.html b/index.html index bbdc3da3..eadd47f9 100644 --- a/index.html +++ b/index.html @@ -1559,7 +1559,7 @@ }); let sdoMap = JSON.parse(`{}`); -let biblio = JSON.parse(`{"refsByClause":{"sec-decimal.prototype.exponent":["_ref_0","_ref_119","_ref_120","_ref_121"],"sec-decimal.prototype.mantissa":["_ref_1","_ref_122","_ref_123","_ref_124","_ref_125","_ref_126","_ref_127","_ref_128","_ref_129","_ref_130","_ref_131"],"sec-decimal-method-round":["_ref_2","_ref_3","_ref_233","_ref_234","_ref_235","_ref_236","_ref_237","_ref_238"],"sec-decimal.prototype.tolocalestring":["_ref_4"],"sec-decimal.prototype.tofixed":["_ref_5","_ref_251","_ref_252","_ref_253","_ref_254"],"sec-decimal.prototype.toprecision":["_ref_6","_ref_255","_ref_256","_ref_257","_ref_258","_ref_259"],"sup-decimal128.prototype.tolocalestring":["_ref_7"],"sec-decimal-intro":["_ref_8","_ref_9","_ref_10","_ref_11","_ref_12","_ref_13","_ref_14","_ref_15","_ref_16","_ref_17","_ref_18","_ref_19","_ref_20","_ref_21","_ref_22","_ref_23","_ref_24","_ref_25","_ref_26","_ref_27","_ref_28","_ref_29","_ref_30","_ref_31","_ref_32","_ref_33","_ref_34","_ref_35","_ref_36","_ref_37","_ref_38","_ref_39","_ref_40","_ref_41","_ref_42","_ref_43","_ref_44","_ref_45","_ref_46","_ref_47","_ref_48","_ref_49","_ref_50","_ref_51","_ref_52","_ref_53","_ref_54","_ref_55","_ref_56","_ref_57","_ref_58","_ref_59","_ref_60","_ref_61","_ref_62","_ref_63","_ref_64","_ref_65","_ref_66","_ref_67","_ref_68","_ref_69","_ref_70"],"sec-decimal-roundtodecimaldomain":["_ref_71","_ref_72","_ref_73","_ref_74","_ref_75","_ref_76","_ref_77"],"sec-decimal-applyroundingmodetopositive":["_ref_78","_ref_79","_ref_80"],"sec-decimal-abs":["_ref_81","_ref_82","_ref_83"],"sec-decimal-negate":["_ref_84","_ref_85","_ref_86"],"sec-decimal-decimaltodecimalstring":["_ref_87","_ref_88","_ref_89","_ref_90"],"sec-decimaltoexponentialstring":["_ref_91","_ref_92","_ref_93","_ref_94"],"sec-decimal-value-to-object":["_ref_95","_ref_96","_ref_97"],"sec-the-decimal-constructor-value":["_ref_98"],"sec-runtime-semantics-stringdecimalvalue":["_ref_99","_ref_100","_ref_101","_ref_102","_ref_103","_ref_104","_ref_105","_ref_106","_ref_107","_ref_108","_ref_109","_ref_110","_ref_111"],"sec-decimal-amount-intro":["_ref_112"],"sec-decimal-amount-create-decimal-armount":["_ref_113","_ref_114","_ref_115","_ref_116"],"sec-the-decimal-amount-constructor-value":["_ref_117","_ref_118"],"sec-decimal.prototype.abs":["_ref_132","_ref_133"],"sec-decimal.prototype.negate":["_ref_134","_ref_135","_ref_136"],"sec-decimal.prototype.add":["_ref_137","_ref_138","_ref_139","_ref_140","_ref_141","_ref_142","_ref_143","_ref_144"],"sec-decimal.prototype.subtract":["_ref_145","_ref_146","_ref_147","_ref_148","_ref_149","_ref_150","_ref_151","_ref_152"],"sec-decimal.prototype.multiply":["_ref_153","_ref_154","_ref_155","_ref_156","_ref_157","_ref_158","_ref_159","_ref_160","_ref_161","_ref_162","_ref_163","_ref_164","_ref_165","_ref_166","_ref_167","_ref_168","_ref_169","_ref_170","_ref_171","_ref_172","_ref_173","_ref_174","_ref_175","_ref_176","_ref_177"],"sec-decimal.prototype.divide":["_ref_178","_ref_179","_ref_180","_ref_181","_ref_182","_ref_183","_ref_184","_ref_185","_ref_186","_ref_187","_ref_188","_ref_189","_ref_190","_ref_191","_ref_192","_ref_193","_ref_194","_ref_195","_ref_196","_ref_197","_ref_198","_ref_199","_ref_200","_ref_201","_ref_202","_ref_203","_ref_204"],"sec-decimal.prototype.remainder":["_ref_205","_ref_206","_ref_207","_ref_208","_ref_209","_ref_210","_ref_211"],"sec-decimal.prototype.compare":["_ref_212","_ref_213","_ref_214","_ref_215"],"sec-decimal.prototype.equals":["_ref_216","_ref_217","_ref_218"],"sec-decimal.prototype.notequals":["_ref_219","_ref_220","_ref_221"],"sec-decimal.prototype.lessthan":["_ref_222","_ref_223","_ref_224"],"sec-decimal.prototype.lessthanorequal":["_ref_225","_ref_226","_ref_227"],"sec-decimal.prototype.greaterthan":["_ref_228","_ref_229","_ref_230"],"sec-decimal.prototype.greaterthanorequal":["_ref_231","_ref_232"],"sec-decimal-method-scale10":["_ref_239","_ref_240","_ref_241","_ref_242","_ref_243","_ref_244","_ref_245","_ref_246","_ref_247"],"sec-decimal.prototype.tostring":["_ref_248","_ref_249"],"sec-decimal.prototype.toexponential":["_ref_250"],"sec-decimal.prototype.withfractionaldigits":["_ref_260","_ref_261","_ref_262"],"sec-decimal.prototype.withsignificantdigits":["_ref_263"],"sec-number-constructor-number-value":["_ref_264"],"sec-bigint-constructor-number-value":["_ref_265"],"sec-tointlmathematicalvalue":["_ref_266","_ref_267","_ref_268","_ref_269"],"sec-resolvepluralrange":["_ref_270","_ref_271"]},"entries":[{"type":"clause","id":"sec-decimal-intro-","titleHTML":"Introduction","number":""},{"type":"term","term":"Decimal value","id":"def-decimal-value","referencingIds":["_ref_11","_ref_12","_ref_14","_ref_17","_ref_20","_ref_24","_ref_28","_ref_36","_ref_45","_ref_51","_ref_55","_ref_59","_ref_64","_ref_66","_ref_68","_ref_70","_ref_81","_ref_82","_ref_83","_ref_84","_ref_85","_ref_86","_ref_87","_ref_91","_ref_95","_ref_96","_ref_99","_ref_112","_ref_114","_ref_122","_ref_155","_ref_162"]},{"type":"term","term":"finite","id":"dfn-decimal-finite","referencingIds":["_ref_15","_ref_19","_ref_34","_ref_40","_ref_43","_ref_47","_ref_49","_ref_53","_ref_63","_ref_69","_ref_101","_ref_113"]},{"type":"term","term":"zero","id":"dfn-decimal-zero","referencingIds":["_ref_8","_ref_9","_ref_16","_ref_26","_ref_27","_ref_35","_ref_41","_ref_44","_ref_48","_ref_50","_ref_54","_ref_61","_ref_65","_ref_67","_ref_120","_ref_124","_ref_125","_ref_154","_ref_161"]},{"type":"term","term":"mathematical value","id":"decimal-mathematical-value","referencingIds":["_ref_10","_ref_13","_ref_18","_ref_37","_ref_71","_ref_73","_ref_74","_ref_76","_ref_78","_ref_80","_ref_115","_ref_119","_ref_121","_ref_123","_ref_130","_ref_216","_ref_219","_ref_222","_ref_225","_ref_228","_ref_260","_ref_267","_ref_268","_ref_269"]},{"type":"op","aoid":"MV","id":"dfn-decimal-mv","referencingIds":["_ref_21","_ref_22","_ref_23","_ref_102","_ref_103","_ref_104","_ref_106","_ref_107","_ref_109","_ref_110","_ref_212","_ref_213","_ref_214","_ref_215","_ref_217","_ref_218","_ref_220","_ref_221","_ref_223","_ref_224","_ref_226","_ref_227","_ref_229","_ref_230","_ref_231","_ref_232"]},{"type":"term","term":"Decimal rounding mode","id":"dfn-decimal-rounding-mode","referencingIds":["_ref_5","_ref_25","_ref_72","_ref_79"]},{"type":"term","term":"default rounding mode","id":"dfn-decimal-default-rounding-mode","referencingIds":["_ref_2","_ref_3"]},{"type":"table","id":"table-decimal-rounding-modes","number":1,"caption":"Table 1: Rounding modes in Decimal128 compared to IEEE 754-2019 rounding modes"},{"type":"op","aoid":"sign","id":"dfn-decimal-sign","referencingIds":["_ref_29","_ref_30","_ref_31","_ref_32","_ref_33","_ref_88","_ref_92","_ref_134","_ref_157","_ref_158","_ref_164","_ref_165","_ref_168","_ref_169","_ref_172","_ref_173","_ref_180","_ref_184","_ref_187","_ref_190","_ref_235","_ref_251","_ref_256"]},{"type":"term","term":"exponent","id":"dfn-decimal-exponent","referencingIds":["_ref_0","_ref_38","_ref_46","_ref_52","_ref_56","_ref_60"]},{"type":"term","term":"significand","id":"dfn-decimal-significand","referencingIds":["_ref_1","_ref_39","_ref_42"]},{"type":"term","term":"normalized","id":"dfn-decimal-normalized","referencingIds":["_ref_57","_ref_58"]},{"type":"term","term":"denormalized","id":"dfn-decimal-denormalized-","referencingIds":["_ref_62"]},{"type":"term","term":"truncated exponent","refId":"sec-decimal-intro"},{"type":"term","term":"scaled significand","refId":"sec-decimal-intro"},{"type":"clause","id":"sec-decimal-intro","titleHTML":"Introduction","number":""},{"type":"op","aoid":"RoundToDecimalDomain","refId":"sec-decimal-roundtodecimaldomain"},{"type":"clause","id":"sec-decimal-roundtodecimaldomain","title":"RoundToDecimalDomain ( v [ , roundingMode ] )","titleHTML":"RoundToDecimalDomain ( v [ , roundingMode ] )","number":"1.1.1","referencingIds":["_ref_75","_ref_105","_ref_108","_ref_111","_ref_144","_ref_152","_ref_177","_ref_204","_ref_238","_ref_247"]},{"type":"op","aoid":"ApplyRoundingModeToPositive","refId":"sec-decimal-applyroundingmodetopositive"},{"type":"clause","id":"sec-decimal-applyroundingmodetopositive","title":"ApplyRoundingModeToPositive ( m, roundingMode )","titleHTML":"ApplyRoundingModeToPositive ( m, roundingMode )","number":"1.1.2","referencingIds":["_ref_77","_ref_236","_ref_252","_ref_258"]},{"type":"op","aoid":"DecimalAbs","refId":"sec-decimal-abs"},{"type":"clause","id":"sec-decimal-abs","title":"DecimalAbs ( argument )","titleHTML":"DecimalAbs ( argument )","number":"1.1.3","referencingIds":["_ref_89","_ref_93","_ref_133"]},{"type":"op","aoid":"DecimalNegate","refId":"sec-decimal-negate"},{"type":"clause","id":"sec-decimal-negate","title":"DecimalNegate ( argument )","titleHTML":"DecimalNegate ( argument )","number":"1.1.4","referencingIds":["_ref_136"]},{"type":"op","aoid":"CanonicalizeDecimalString","refId":"sec-decimal-canonicalizedecimalstring"},{"type":"clause","id":"sec-decimal-canonicalizedecimalstring","title":"CanonicalizeDecimalString ( digits )","titleHTML":"CanonicalizeDecimalString ( digits )","number":"1.1.5","referencingIds":["_ref_90","_ref_254"]},{"type":"op","aoid":"DecimalToDecimalString","refId":"sec-decimal-decimaltodecimalstring"},{"type":"clause","id":"sec-decimal-decimaltodecimalstring","title":"DecimalToDecimalString ( argument )","titleHTML":"DecimalToDecimalString ( argument )","number":"1.1.6","referencingIds":["_ref_94","_ref_249","_ref_253","_ref_255","_ref_257","_ref_259"]},{"type":"op","aoid":"DecimalToExponentialString","refId":"sec-decimaltoexponentialstring"},{"type":"clause","id":"sec-decimaltoexponentialstring","title":"DecimalToExponentialString ( argument )","titleHTML":"DecimalToExponentialString ( argument )","number":"1.1.7","referencingIds":["_ref_248","_ref_250","_ref_264"]},{"type":"op","aoid":"DecimalValueToObject","refId":"sec-decimal-value-to-object"},{"type":"clause","id":"sec-decimal-value-to-object","title":"DecimalValueToObject ( argument )","titleHTML":"DecimalValueToObject ( argument )","number":"1.1.8","referencingIds":["_ref_126","_ref_127","_ref_128","_ref_129","_ref_131","_ref_132","_ref_135","_ref_137","_ref_138","_ref_139","_ref_140","_ref_141","_ref_142","_ref_143","_ref_145","_ref_146","_ref_147","_ref_148","_ref_149","_ref_150","_ref_151","_ref_153","_ref_156","_ref_159","_ref_160","_ref_163","_ref_166","_ref_167","_ref_170","_ref_171","_ref_174","_ref_175","_ref_176","_ref_178","_ref_179","_ref_181","_ref_182","_ref_183","_ref_185","_ref_186","_ref_188","_ref_189","_ref_191","_ref_192","_ref_193","_ref_194","_ref_195","_ref_196","_ref_197","_ref_198","_ref_199","_ref_200","_ref_201","_ref_202","_ref_203","_ref_205","_ref_206","_ref_207","_ref_208","_ref_209","_ref_210","_ref_211","_ref_233","_ref_234","_ref_237","_ref_239","_ref_240","_ref_241","_ref_242","_ref_243","_ref_244","_ref_245","_ref_246"]},{"type":"clause","id":"sec-decimal-abstract-ops","titleHTML":"Abstract Operations","number":"1.1"},{"type":"term","term":"%Decimal%","refId":"sec-the-decimal-constructor"},{"type":"op","aoid":"StringDecimalValue","refId":"sec-runtime-semantics-stringdecimalvalue"},{"type":"clause","id":"sec-runtime-semantics-stringdecimalvalue","titleHTML":"Runtime Semantics: StringDecimalValue","number":"1.2.1.1","referencingIds":["_ref_98","_ref_100"]},{"type":"clause","id":"sec-the-decimal-constructor-value","title":"Decimal ( x )","titleHTML":"Decimal ( x )","number":"1.2.1"},{"type":"clause","id":"sec-decimal-amount-intro","titleHTML":"Introduction","number":""},{"type":"op","aoid":"CreateDecimalAmount","refId":"sec-decimal-amount-create-decimal-armount"},{"type":"clause","id":"sec-decimal-amount-create-decimal-armount","title":"CreateDecimalAmount ( value, digits )","titleHTML":"CreateDecimalAmount ( value, digits )","number":"1.2.2.1.1","referencingIds":["_ref_118","_ref_262","_ref_263"]},{"type":"clause","id":"sec-decimal-amount-abstract-ops","titleHTML":"Abstract Operations","number":"1.2.2.1"},{"type":"term","term":"%DecimalAmount%","refId":"sec-the-decimal-amount-constructor"},{"type":"clause","id":"sec-the-decimal-amount-constructor-value","title":"Decimal.Amount ( s, precision )","titleHTML":"Decimal.Amount ( s, precision )","number":"1.2.2.2.1"},{"type":"clause","id":"sec-the-decimal-amount-constructor","titleHTML":"The Decimal.Amount Constructor","number":"1.2.2.2","referencingIds":["_ref_116","_ref_261"]},{"type":"clause","id":"sec-the-decimal-amount-object","titleHTML":"The Decimal.Amount Object","number":"1.2.2"},{"type":"clause","id":"sec-the-decimal-constructor","titleHTML":"The Decimal Constructor","number":"1.2","referencingIds":["_ref_97","_ref_117"]},{"type":"clause","id":"sec-the-decimal-object","titleHTML":"The Decimal Object","number":"1"},{"type":"clause","id":"sec-decimal.prototype.isnan","titleHTML":"Decimal.prototype.isNaN ( )","number":"2.1"},{"type":"clause","id":"sec-decimal.prototype.isfinite","titleHTML":"Decimal.prototype.isFinite ( )","number":"2.2"},{"type":"clause","id":"sec-decimal.prototype.exponent","titleHTML":"Decimal.prototype.exponent ( )","number":"2.3"},{"type":"clause","id":"sec-decimal.prototype.mantissa","titleHTML":"Decimal.prototype.mantissa ( )","number":"2.4"},{"type":"clause","id":"sec-decimal.prototype.abs","titleHTML":"Decimal.prototype.abs ( )","number":"2.5"},{"type":"clause","id":"sec-decimal.prototype.negate","titleHTML":"Decimal.prototype.negate ( )","number":"2.6"},{"type":"clause","id":"sec-decimal.prototype.add","title":"Decimal.prototype.add ( x )","titleHTML":"Decimal.prototype.add ( x )","number":"2.7"},{"type":"clause","id":"sec-decimal.prototype.subtract","title":"Decimal.prototype.subtract ( x )","titleHTML":"Decimal.prototype.subtract ( x )","number":"2.8"},{"type":"clause","id":"sec-decimal.prototype.multiply","title":"Decimal.prototype.multiply ( x )","titleHTML":"Decimal.prototype.multiply ( x )","number":"2.9"},{"type":"clause","id":"sec-decimal.prototype.divide","title":"Decimal.prototype.divide ( x )","titleHTML":"Decimal.prototype.divide ( x )","number":"2.10"},{"type":"clause","id":"sec-decimal.prototype.remainder","title":"Decimal.prototype.remainder ( x )","titleHTML":"Decimal.prototype.remainder ( x )","number":"2.11"},{"type":"clause","id":"sec-decimal.prototype.compare","title":"Decimal.prototype.compare ( x )","titleHTML":"Decimal.prototype.compare ( x )","number":"2.12"},{"type":"clause","id":"sec-decimal.prototype.equals","title":"Decimal.prototype.equals ( x )","titleHTML":"Decimal.prototype.equals ( x )","number":"2.13"},{"type":"clause","id":"sec-decimal.prototype.notequals","title":"Decimal.prototype.notEquals ( x )","titleHTML":"Decimal.prototype.notEquals ( x )","number":"2.14"},{"type":"clause","id":"sec-decimal.prototype.lessthan","title":"Decimal.prototype.lessThan ( x )","titleHTML":"Decimal.prototype.lessThan ( x )","number":"2.15"},{"type":"clause","id":"sec-decimal.prototype.lessthanorequal","title":"Decimal.prototype.lessThanOrEqual ( x )","titleHTML":"Decimal.prototype.lessThanOrEqual ( x )","number":"2.16"},{"type":"clause","id":"sec-decimal.prototype.greaterthan","title":"Decimal.prototype.greaterThan ( x )","titleHTML":"Decimal.prototype.greaterThan ( x )","number":"2.17"},{"type":"clause","id":"sec-decimal.prototype.greaterthanorequal","title":"Decimal.prototype.greaterThanOrEqual ( x )","titleHTML":"Decimal.prototype.greaterThanOrEqual ( x )","number":"2.18"},{"type":"clause","id":"sec-decimal-method-round","title":"Decimal.prototype.round ( numFractionalDigits [ , roundingMode ] )","titleHTML":"Decimal.prototype.round ( numFractionalDigits [ , roundingMode ] )","number":"2.19"},{"type":"clause","id":"sec-decimal-method-scale10","title":"Decimal.prototype.scale10 ( n )","titleHTML":"Decimal.prototype.scale10 ( n )","number":"2.20"},{"type":"clause","id":"sec-decimal.prototype.tostring","title":"Decimal.prototype.toString ( [ options ] )","titleHTML":"Decimal.prototype.toString ( [ options ] )","number":"2.21","referencingIds":["_ref_4","_ref_6"]},{"type":"clause","id":"sec-decimal.prototype.tolocalestring","title":"Decimal.prototype.toLocaleString ( [ reserved1 [ , reserved2 ] ] )","titleHTML":"Decimal.prototype.toLocaleString ( [ reserved1 [ , reserved2 ] ] )","number":"2.22","referencingIds":["_ref_7"]},{"type":"clause","id":"sec-decimal.prototype.toexponential","title":"Decimal.prototype.toExponential ( [ options ] )","titleHTML":"Decimal.prototype.toExponential ( [ options ] )","number":"2.23"},{"type":"clause","id":"sec-decimal.prototype.tofixed","title":"Decimal.prototype.toFixed ( [ options ] )","titleHTML":"Decimal.prototype.toFixed ( [ options ] )","number":"2.24"},{"type":"clause","id":"sec-decimal.prototype.tojson","titleHTML":"Decimal.prototype.toJSON ( )","number":"2.25"},{"type":"clause","id":"sec-decimal.prototype.toprecision","title":"Decimal.prototype.toPrecision ( [ options ] )","titleHTML":"Decimal.prototype.toPrecision ( [ options ] )","number":"2.26"},{"type":"clause","id":"sec-decimal.prototype.withfractionaldigits","title":"Decimal.prototype.withFractionalDigits ( n )","titleHTML":"Decimal.prototype.withFractionalDigits ( n )","number":"2.27"},{"type":"clause","id":"sec-decimal.prototype.withsignificantdigits","title":"Decimal.prototype.withSignificantDigits ( n )","titleHTML":"Decimal.prototype.withSignificantDigits ( n )","number":"2.28"},{"type":"clause","id":"sec-decimal.prototype.valueof","title":"Decimal.prototype.valueOf ( x )","titleHTML":"Decimal.prototype.valueOf ( x )","number":"2.29"},{"type":"clause","id":"sec-decimal-prototype-properties","titleHTML":"Properties of the Decimal Prototype","number":"2"},{"type":"clause","id":"sec-number-constructor-number-value","title":"Number ( value )","titleHTML":"Number ( value )","number":"3.1.1.1"},{"type":"clause","id":"sec-number-constructor","titleHTML":"The Number Constructor","number":"3.1.1"},{"type":"clause","id":"sec-number-objects","titleHTML":"Number Objects","number":"3.1"},{"type":"op","aoid":"DecimalToBigInt","refId":"sec-numbertobigint"},{"type":"clause","id":"sec-numbertobigint","title":"DecimalToBigInt ( number )","titleHTML":"DecimalToBigInt ( number )","number":"3.2.1.1.1","referencingIds":["_ref_265"]},{"type":"clause","id":"sec-bigint-constructor-number-value","title":"BigInt ( value )","titleHTML":"BigInt ( value )","number":"3.2.1.1"},{"type":"clause","id":"sec-bigint-constructor","titleHTML":"The BigInt Constructor","number":"3.2.1"},{"type":"clause","id":"sec-bigint-objects","titleHTML":"BigInt Objects","number":"3.2"},{"type":"clause","id":"sec-numbers-and-dates","titleHTML":"Numbers and Dates","number":"3"},{"type":"clause","id":"sup-decimal128.prototype.tolocalestring","title":"Decimal128.prototype.toLocaleString ( [ locales [ , options ] ] )","titleHTML":"Decimal128.prototype.toLocaleString ( [ locales [ , options ] ] )","number":"4.1.1"},{"type":"clause","id":"sup-properties-of-the-decimal128-prototype-object","titleHTML":"Properties of the Decimal128 Prototype Object","number":"4.1"},{"type":"term","term":"Intl mathematical value","id":"intl-mathematical-value","referencingIds":["_ref_266"]},{"type":"op","aoid":"ToIntlMathematicalValue","refId":"sec-tointlmathematicalvalue"},{"type":"clause","id":"sec-tointlmathematicalvalue","title":"ToIntlMathematicalValue ( value )","titleHTML":"ToIntlMathematicalValue ( value )","number":"4.2.1.1"},{"type":"clause","id":"sec-numberformat-abstracts","titleHTML":"Abstract Operations for NumberFormat Objects","number":"4.2.1"},{"type":"clause","id":"numberformat-objects","titleHTML":"NumberFormat Objects","number":"4.2"},{"type":"op","aoid":"ResolvePlural","refId":"sec-resolveplural"},{"type":"clause","id":"sec-resolveplural","title":"ResolvePlural ( pluralRules, n )","titleHTML":"ResolvePlural ( pluralRules, n )","number":"4.3.1.1","referencingIds":["_ref_270","_ref_271"]},{"type":"op","aoid":"ResolvePluralRange","refId":"sec-resolvepluralrange"},{"type":"clause","id":"sec-resolvepluralrange","title":"ResolvePluralRange ( pluralRules, x, y )","titleHTML":"ResolvePluralRange ( pluralRules, x, y )","number":"4.3.1.2"},{"type":"clause","id":"sec-intl-pluralrules-abstracts","titleHTML":"Abstract Operations for PluralRules Objects","number":"4.3.1"},{"type":"clause","id":"pluralrules-objects","titleHTML":"PluralRules Objects","number":"4.3"},{"type":"clause","id":"sec-decimal-intl","titleHTML":"Amendments to the ECMAScript® 2024 Internationalization API Specification","number":"4"},{"type":"clause","id":"sec-copyright-and-software-license","title":"Copyright & Software License","titleHTML":"Copyright & Software License","number":"A"}]}`); +let biblio = JSON.parse(`{"refsByClause":{"sec-decimal.prototype.exponent":["_ref_0","_ref_112","_ref_113","_ref_114"],"sec-decimal.prototype.mantissa":["_ref_1","_ref_115","_ref_116","_ref_117","_ref_118","_ref_119","_ref_120","_ref_121","_ref_122","_ref_123","_ref_124"],"sec-decimal-method-round":["_ref_2","_ref_3","_ref_226","_ref_227","_ref_228","_ref_229","_ref_230","_ref_231"],"sec-decimal.prototype.tolocalestring":["_ref_4"],"sec-decimal.prototype.tofixed":["_ref_5","_ref_244","_ref_245","_ref_246","_ref_247"],"sec-decimal.prototype.toprecision":["_ref_6","_ref_248","_ref_249","_ref_250","_ref_251","_ref_252"],"sup-decimal128.prototype.tolocalestring":["_ref_7"],"sec-decimal-intro":["_ref_8","_ref_9","_ref_10","_ref_11","_ref_12","_ref_13","_ref_14","_ref_15","_ref_16","_ref_17","_ref_18","_ref_19","_ref_20","_ref_21","_ref_22","_ref_23","_ref_24","_ref_25","_ref_26","_ref_27","_ref_28","_ref_29","_ref_30","_ref_31","_ref_32","_ref_33","_ref_34","_ref_35","_ref_36","_ref_37","_ref_38","_ref_39","_ref_40","_ref_41","_ref_42","_ref_43","_ref_44","_ref_45","_ref_46","_ref_47","_ref_48","_ref_49","_ref_50","_ref_51","_ref_52","_ref_53","_ref_54","_ref_55","_ref_56","_ref_57","_ref_58","_ref_59","_ref_60","_ref_61","_ref_62","_ref_63","_ref_64","_ref_65","_ref_66","_ref_67","_ref_68","_ref_69","_ref_70"],"sec-decimal-roundtodecimaldomain":["_ref_71","_ref_72","_ref_73","_ref_74","_ref_75","_ref_76","_ref_77"],"sec-decimal-applyroundingmodetopositive":["_ref_78","_ref_79","_ref_80"],"sec-decimal-abs":["_ref_81","_ref_82","_ref_83"],"sec-decimal-negate":["_ref_84","_ref_85","_ref_86"],"sec-decimal-decimaltodecimalstring":["_ref_87","_ref_88","_ref_89","_ref_90"],"sec-decimaltoexponentialstring":["_ref_91","_ref_92","_ref_93","_ref_94"],"sec-decimal-value-to-object":["_ref_95","_ref_96","_ref_97"],"sec-the-decimal-constructor-value":["_ref_98"],"sec-runtime-semantics-stringdecimalvalue":["_ref_99","_ref_100","_ref_101","_ref_102","_ref_103","_ref_104","_ref_105","_ref_106","_ref_107","_ref_108","_ref_109","_ref_110","_ref_111"],"sec-decimal.prototype.abs":["_ref_125","_ref_126"],"sec-decimal.prototype.negate":["_ref_127","_ref_128","_ref_129"],"sec-decimal.prototype.add":["_ref_130","_ref_131","_ref_132","_ref_133","_ref_134","_ref_135","_ref_136","_ref_137"],"sec-decimal.prototype.subtract":["_ref_138","_ref_139","_ref_140","_ref_141","_ref_142","_ref_143","_ref_144","_ref_145"],"sec-decimal.prototype.multiply":["_ref_146","_ref_147","_ref_148","_ref_149","_ref_150","_ref_151","_ref_152","_ref_153","_ref_154","_ref_155","_ref_156","_ref_157","_ref_158","_ref_159","_ref_160","_ref_161","_ref_162","_ref_163","_ref_164","_ref_165","_ref_166","_ref_167","_ref_168","_ref_169","_ref_170"],"sec-decimal.prototype.divide":["_ref_171","_ref_172","_ref_173","_ref_174","_ref_175","_ref_176","_ref_177","_ref_178","_ref_179","_ref_180","_ref_181","_ref_182","_ref_183","_ref_184","_ref_185","_ref_186","_ref_187","_ref_188","_ref_189","_ref_190","_ref_191","_ref_192","_ref_193","_ref_194","_ref_195","_ref_196","_ref_197"],"sec-decimal.prototype.remainder":["_ref_198","_ref_199","_ref_200","_ref_201","_ref_202","_ref_203","_ref_204"],"sec-decimal.prototype.compare":["_ref_205","_ref_206","_ref_207","_ref_208"],"sec-decimal.prototype.equals":["_ref_209","_ref_210","_ref_211"],"sec-decimal.prototype.notequals":["_ref_212","_ref_213","_ref_214"],"sec-decimal.prototype.lessthan":["_ref_215","_ref_216","_ref_217"],"sec-decimal.prototype.lessthanorequal":["_ref_218","_ref_219","_ref_220"],"sec-decimal.prototype.greaterthan":["_ref_221","_ref_222","_ref_223"],"sec-decimal.prototype.greaterthanorequal":["_ref_224","_ref_225"],"sec-decimal-method-scale10":["_ref_232","_ref_233","_ref_234","_ref_235","_ref_236","_ref_237","_ref_238","_ref_239","_ref_240"],"sec-decimal.prototype.tostring":["_ref_241","_ref_242"],"sec-decimal.prototype.toexponential":["_ref_243"],"sec-number-constructor-number-value":["_ref_253"],"sec-bigint-constructor-number-value":["_ref_254"],"sec-tointlmathematicalvalue":["_ref_255","_ref_256","_ref_257","_ref_258"],"sec-resolvepluralrange":["_ref_259","_ref_260"]},"entries":[{"type":"clause","id":"sec-decimal-intro-","titleHTML":"Introduction","number":""},{"type":"term","term":"Decimal value","id":"def-decimal-value","referencingIds":["_ref_11","_ref_12","_ref_14","_ref_17","_ref_20","_ref_24","_ref_28","_ref_36","_ref_45","_ref_51","_ref_55","_ref_59","_ref_64","_ref_66","_ref_68","_ref_70","_ref_81","_ref_82","_ref_83","_ref_84","_ref_85","_ref_86","_ref_87","_ref_91","_ref_95","_ref_96","_ref_99","_ref_115","_ref_148","_ref_155"]},{"type":"term","term":"finite","id":"dfn-decimal-finite","referencingIds":["_ref_15","_ref_19","_ref_34","_ref_40","_ref_43","_ref_47","_ref_49","_ref_53","_ref_63","_ref_69","_ref_101"]},{"type":"term","term":"zero","id":"dfn-decimal-zero","referencingIds":["_ref_8","_ref_9","_ref_16","_ref_26","_ref_27","_ref_35","_ref_41","_ref_44","_ref_48","_ref_50","_ref_54","_ref_61","_ref_65","_ref_67","_ref_113","_ref_117","_ref_118","_ref_147","_ref_154"]},{"type":"term","term":"mathematical value","id":"decimal-mathematical-value","referencingIds":["_ref_10","_ref_13","_ref_18","_ref_37","_ref_71","_ref_73","_ref_74","_ref_76","_ref_78","_ref_80","_ref_112","_ref_114","_ref_116","_ref_123","_ref_209","_ref_212","_ref_215","_ref_218","_ref_221","_ref_256","_ref_257","_ref_258"]},{"type":"op","aoid":"MV","id":"dfn-decimal-mv","referencingIds":["_ref_21","_ref_22","_ref_23","_ref_102","_ref_103","_ref_104","_ref_106","_ref_107","_ref_109","_ref_110","_ref_205","_ref_206","_ref_207","_ref_208","_ref_210","_ref_211","_ref_213","_ref_214","_ref_216","_ref_217","_ref_219","_ref_220","_ref_222","_ref_223","_ref_224","_ref_225"]},{"type":"term","term":"Decimal rounding mode","id":"dfn-decimal-rounding-mode","referencingIds":["_ref_5","_ref_25","_ref_72","_ref_79"]},{"type":"term","term":"default rounding mode","id":"dfn-decimal-default-rounding-mode","referencingIds":["_ref_2","_ref_3"]},{"type":"table","id":"table-decimal-rounding-modes","number":1,"caption":"Table 1: Rounding modes in Decimal128 compared to IEEE 754-2019 rounding modes"},{"type":"op","aoid":"sign","id":"dfn-decimal-sign","referencingIds":["_ref_29","_ref_30","_ref_31","_ref_32","_ref_33","_ref_88","_ref_92","_ref_127","_ref_150","_ref_151","_ref_157","_ref_158","_ref_161","_ref_162","_ref_165","_ref_166","_ref_173","_ref_177","_ref_180","_ref_183","_ref_228","_ref_244","_ref_249"]},{"type":"term","term":"exponent","id":"dfn-decimal-exponent","referencingIds":["_ref_0","_ref_38","_ref_46","_ref_52","_ref_56","_ref_60"]},{"type":"term","term":"significand","id":"dfn-decimal-significand","referencingIds":["_ref_1","_ref_39","_ref_42"]},{"type":"term","term":"normalized","id":"dfn-decimal-normalized","referencingIds":["_ref_57","_ref_58"]},{"type":"term","term":"denormalized","id":"dfn-decimal-denormalized-","referencingIds":["_ref_62"]},{"type":"term","term":"truncated exponent","refId":"sec-decimal-intro"},{"type":"term","term":"scaled significand","refId":"sec-decimal-intro"},{"type":"clause","id":"sec-decimal-intro","titleHTML":"Introduction","number":""},{"type":"op","aoid":"RoundToDecimalDomain","refId":"sec-decimal-roundtodecimaldomain"},{"type":"clause","id":"sec-decimal-roundtodecimaldomain","title":"RoundToDecimalDomain ( v [ , roundingMode ] )","titleHTML":"RoundToDecimalDomain ( v [ , roundingMode ] )","number":"1.1.1","referencingIds":["_ref_75","_ref_105","_ref_108","_ref_111","_ref_137","_ref_145","_ref_170","_ref_197","_ref_231","_ref_240"]},{"type":"op","aoid":"ApplyRoundingModeToPositive","refId":"sec-decimal-applyroundingmodetopositive"},{"type":"clause","id":"sec-decimal-applyroundingmodetopositive","title":"ApplyRoundingModeToPositive ( m, roundingMode )","titleHTML":"ApplyRoundingModeToPositive ( m, roundingMode )","number":"1.1.2","referencingIds":["_ref_77","_ref_229","_ref_245","_ref_251"]},{"type":"op","aoid":"DecimalAbs","refId":"sec-decimal-abs"},{"type":"clause","id":"sec-decimal-abs","title":"DecimalAbs ( argument )","titleHTML":"DecimalAbs ( argument )","number":"1.1.3","referencingIds":["_ref_89","_ref_93","_ref_126"]},{"type":"op","aoid":"DecimalNegate","refId":"sec-decimal-negate"},{"type":"clause","id":"sec-decimal-negate","title":"DecimalNegate ( argument )","titleHTML":"DecimalNegate ( argument )","number":"1.1.4","referencingIds":["_ref_129"]},{"type":"op","aoid":"CanonicalizeDecimalString","refId":"sec-decimal-canonicalizedecimalstring"},{"type":"clause","id":"sec-decimal-canonicalizedecimalstring","title":"CanonicalizeDecimalString ( digits )","titleHTML":"CanonicalizeDecimalString ( digits )","number":"1.1.5","referencingIds":["_ref_90","_ref_247"]},{"type":"op","aoid":"DecimalToDecimalString","refId":"sec-decimal-decimaltodecimalstring"},{"type":"clause","id":"sec-decimal-decimaltodecimalstring","title":"DecimalToDecimalString ( argument )","titleHTML":"DecimalToDecimalString ( argument )","number":"1.1.6","referencingIds":["_ref_94","_ref_242","_ref_246","_ref_248","_ref_250","_ref_252"]},{"type":"op","aoid":"DecimalToExponentialString","refId":"sec-decimaltoexponentialstring"},{"type":"clause","id":"sec-decimaltoexponentialstring","title":"DecimalToExponentialString ( argument )","titleHTML":"DecimalToExponentialString ( argument )","number":"1.1.7","referencingIds":["_ref_241","_ref_243","_ref_253"]},{"type":"op","aoid":"DecimalValueToObject","refId":"sec-decimal-value-to-object"},{"type":"clause","id":"sec-decimal-value-to-object","title":"DecimalValueToObject ( argument )","titleHTML":"DecimalValueToObject ( argument )","number":"1.1.8","referencingIds":["_ref_119","_ref_120","_ref_121","_ref_122","_ref_124","_ref_125","_ref_128","_ref_130","_ref_131","_ref_132","_ref_133","_ref_134","_ref_135","_ref_136","_ref_138","_ref_139","_ref_140","_ref_141","_ref_142","_ref_143","_ref_144","_ref_146","_ref_149","_ref_152","_ref_153","_ref_156","_ref_159","_ref_160","_ref_163","_ref_164","_ref_167","_ref_168","_ref_169","_ref_171","_ref_172","_ref_174","_ref_175","_ref_176","_ref_178","_ref_179","_ref_181","_ref_182","_ref_184","_ref_185","_ref_186","_ref_187","_ref_188","_ref_189","_ref_190","_ref_191","_ref_192","_ref_193","_ref_194","_ref_195","_ref_196","_ref_198","_ref_199","_ref_200","_ref_201","_ref_202","_ref_203","_ref_204","_ref_226","_ref_227","_ref_230","_ref_232","_ref_233","_ref_234","_ref_235","_ref_236","_ref_237","_ref_238","_ref_239"]},{"type":"clause","id":"sec-decimal-abstract-ops","titleHTML":"Abstract Operations","number":"1.1"},{"type":"term","term":"%Decimal%","refId":"sec-the-decimal-constructor"},{"type":"op","aoid":"StringDecimalValue","refId":"sec-runtime-semantics-stringdecimalvalue"},{"type":"clause","id":"sec-runtime-semantics-stringdecimalvalue","titleHTML":"Runtime Semantics: StringDecimalValue","number":"1.2.1.1","referencingIds":["_ref_98","_ref_100"]},{"type":"clause","id":"sec-the-decimal-constructor-value","title":"Decimal ( x )","titleHTML":"Decimal ( x )","number":"1.2.1"},{"type":"clause","id":"sec-the-decimal-constructor","titleHTML":"The Decimal Constructor","number":"1.2","referencingIds":["_ref_97"]},{"type":"clause","id":"sec-the-decimal-object","titleHTML":"The Decimal Object","number":"1"},{"type":"clause","id":"sec-decimal.prototype.isnan","titleHTML":"Decimal.prototype.isNaN ( )","number":"2.1"},{"type":"clause","id":"sec-decimal.prototype.isfinite","titleHTML":"Decimal.prototype.isFinite ( )","number":"2.2"},{"type":"clause","id":"sec-decimal.prototype.exponent","titleHTML":"Decimal.prototype.exponent ( )","number":"2.3"},{"type":"clause","id":"sec-decimal.prototype.mantissa","titleHTML":"Decimal.prototype.mantissa ( )","number":"2.4"},{"type":"clause","id":"sec-decimal.prototype.abs","titleHTML":"Decimal.prototype.abs ( )","number":"2.5"},{"type":"clause","id":"sec-decimal.prototype.negate","titleHTML":"Decimal.prototype.negate ( )","number":"2.6"},{"type":"clause","id":"sec-decimal.prototype.add","title":"Decimal.prototype.add ( x )","titleHTML":"Decimal.prototype.add ( x )","number":"2.7"},{"type":"clause","id":"sec-decimal.prototype.subtract","title":"Decimal.prototype.subtract ( x )","titleHTML":"Decimal.prototype.subtract ( x )","number":"2.8"},{"type":"clause","id":"sec-decimal.prototype.multiply","title":"Decimal.prototype.multiply ( x )","titleHTML":"Decimal.prototype.multiply ( x )","number":"2.9"},{"type":"clause","id":"sec-decimal.prototype.divide","title":"Decimal.prototype.divide ( x )","titleHTML":"Decimal.prototype.divide ( x )","number":"2.10"},{"type":"clause","id":"sec-decimal.prototype.remainder","title":"Decimal.prototype.remainder ( x )","titleHTML":"Decimal.prototype.remainder ( x )","number":"2.11"},{"type":"clause","id":"sec-decimal.prototype.compare","title":"Decimal.prototype.compare ( x )","titleHTML":"Decimal.prototype.compare ( x )","number":"2.12"},{"type":"clause","id":"sec-decimal.prototype.equals","title":"Decimal.prototype.equals ( x )","titleHTML":"Decimal.prototype.equals ( x )","number":"2.13"},{"type":"clause","id":"sec-decimal.prototype.notequals","title":"Decimal.prototype.notEquals ( x )","titleHTML":"Decimal.prototype.notEquals ( x )","number":"2.14"},{"type":"clause","id":"sec-decimal.prototype.lessthan","title":"Decimal.prototype.lessThan ( x )","titleHTML":"Decimal.prototype.lessThan ( x )","number":"2.15"},{"type":"clause","id":"sec-decimal.prototype.lessthanorequal","title":"Decimal.prototype.lessThanOrEqual ( x )","titleHTML":"Decimal.prototype.lessThanOrEqual ( x )","number":"2.16"},{"type":"clause","id":"sec-decimal.prototype.greaterthan","title":"Decimal.prototype.greaterThan ( x )","titleHTML":"Decimal.prototype.greaterThan ( x )","number":"2.17"},{"type":"clause","id":"sec-decimal.prototype.greaterthanorequal","title":"Decimal.prototype.greaterThanOrEqual ( x )","titleHTML":"Decimal.prototype.greaterThanOrEqual ( x )","number":"2.18"},{"type":"clause","id":"sec-decimal-method-round","title":"Decimal.prototype.round ( numFractionalDigits [ , roundingMode ] )","titleHTML":"Decimal.prototype.round ( numFractionalDigits [ , roundingMode ] )","number":"2.19"},{"type":"clause","id":"sec-decimal-method-scale10","title":"Decimal.prototype.scale10 ( n )","titleHTML":"Decimal.prototype.scale10 ( n )","number":"2.20"},{"type":"clause","id":"sec-decimal.prototype.tostring","title":"Decimal.prototype.toString ( [ options ] )","titleHTML":"Decimal.prototype.toString ( [ options ] )","number":"2.21","referencingIds":["_ref_4","_ref_6"]},{"type":"clause","id":"sec-decimal.prototype.tolocalestring","title":"Decimal.prototype.toLocaleString ( [ reserved1 [ , reserved2 ] ] )","titleHTML":"Decimal.prototype.toLocaleString ( [ reserved1 [ , reserved2 ] ] )","number":"2.22","referencingIds":["_ref_7"]},{"type":"clause","id":"sec-decimal.prototype.toexponential","title":"Decimal.prototype.toExponential ( [ options ] )","titleHTML":"Decimal.prototype.toExponential ( [ options ] )","number":"2.23"},{"type":"clause","id":"sec-decimal.prototype.tofixed","title":"Decimal.prototype.toFixed ( [ options ] )","titleHTML":"Decimal.prototype.toFixed ( [ options ] )","number":"2.24"},{"type":"clause","id":"sec-decimal.prototype.tojson","titleHTML":"Decimal.prototype.toJSON ( )","number":"2.25"},{"type":"clause","id":"sec-decimal.prototype.toprecision","title":"Decimal.prototype.toPrecision ( [ options ] )","titleHTML":"Decimal.prototype.toPrecision ( [ options ] )","number":"2.26"},{"type":"clause","id":"sec-decimal.prototype.valueof","title":"Decimal.prototype.valueOf ( x )","titleHTML":"Decimal.prototype.valueOf ( x )","number":"2.27"},{"type":"clause","id":"sec-decimal-prototype-properties","titleHTML":"Properties of the Decimal Prototype","number":"2"},{"type":"clause","id":"sec-number-constructor-number-value","title":"Number ( value )","titleHTML":"Number ( value )","number":"3.1.1.1"},{"type":"clause","id":"sec-number-constructor","titleHTML":"The Number Constructor","number":"3.1.1"},{"type":"clause","id":"sec-number-objects","titleHTML":"Number Objects","number":"3.1"},{"type":"op","aoid":"DecimalToBigInt","refId":"sec-numbertobigint"},{"type":"clause","id":"sec-numbertobigint","title":"DecimalToBigInt ( number )","titleHTML":"DecimalToBigInt ( number )","number":"3.2.1.1.1","referencingIds":["_ref_254"]},{"type":"clause","id":"sec-bigint-constructor-number-value","title":"BigInt ( value )","titleHTML":"BigInt ( value )","number":"3.2.1.1"},{"type":"clause","id":"sec-bigint-constructor","titleHTML":"The BigInt Constructor","number":"3.2.1"},{"type":"clause","id":"sec-bigint-objects","titleHTML":"BigInt Objects","number":"3.2"},{"type":"clause","id":"sec-numbers-and-dates","titleHTML":"Numbers and Dates","number":"3"},{"type":"clause","id":"sup-decimal128.prototype.tolocalestring","title":"Decimal128.prototype.toLocaleString ( [ locales [ , options ] ] )","titleHTML":"Decimal128.prototype.toLocaleString ( [ locales [ , options ] ] )","number":"4.1.1"},{"type":"clause","id":"sup-properties-of-the-decimal128-prototype-object","titleHTML":"Properties of the Decimal128 Prototype Object","number":"4.1"},{"type":"term","term":"Intl mathematical value","id":"intl-mathematical-value","referencingIds":["_ref_255"]},{"type":"op","aoid":"ToIntlMathematicalValue","refId":"sec-tointlmathematicalvalue"},{"type":"clause","id":"sec-tointlmathematicalvalue","title":"ToIntlMathematicalValue ( value )","titleHTML":"ToIntlMathematicalValue ( value )","number":"4.2.1.1"},{"type":"clause","id":"sec-numberformat-abstracts","titleHTML":"Abstract Operations for NumberFormat Objects","number":"4.2.1"},{"type":"clause","id":"numberformat-objects","titleHTML":"NumberFormat Objects","number":"4.2"},{"type":"op","aoid":"ResolvePlural","refId":"sec-resolveplural"},{"type":"clause","id":"sec-resolveplural","title":"ResolvePlural ( pluralRules, n )","titleHTML":"ResolvePlural ( pluralRules, n )","number":"4.3.1.1","referencingIds":["_ref_259","_ref_260"]},{"type":"op","aoid":"ResolvePluralRange","refId":"sec-resolvepluralrange"},{"type":"clause","id":"sec-resolvepluralrange","title":"ResolvePluralRange ( pluralRules, x, y )","titleHTML":"ResolvePluralRange ( pluralRules, x, y )","number":"4.3.1.2"},{"type":"clause","id":"sec-intl-pluralrules-abstracts","titleHTML":"Abstract Operations for PluralRules Objects","number":"4.3.1"},{"type":"clause","id":"pluralrules-objects","titleHTML":"PluralRules Objects","number":"4.3"},{"type":"clause","id":"sec-decimal-intl","titleHTML":"Amendments to the ECMAScript® 2024 Internationalization API Specification","number":"4"},{"type":"clause","id":"sec-copyright-and-software-license","title":"Copyright & Software License","titleHTML":"Copyright & Software License","number":"A"}]}`); ;let usesMultipage = false