Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit fb90e18

Browse files
committed
WIP
1 parent a0046da commit fb90e18

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/decimal128.mts

+4-6
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,16 @@ type Decimal128Value = NaNValue | InfiniteValue | FiniteValue;
6868
const NAN = "NaN";
6969
const POSITIVE_INFINITY = "Infinity";
7070
const NEGATIVE_INFINITY = "-Infinity";
71-
const TEN_MAX_EXPONENT = new Rational(bigTen, bigOne).scale10(EXPONENT_MAX);
71+
const TEN_MAX_EXPONENT = new Rational(bigTen, bigOne).scale10(
72+
MAX_SIGNIFICANT_DIGITS
73+
);
7274

7375
function pickQuantum(d: Rational, preferredQuantum: number): number {
7476
return preferredQuantum;
7577
}
7678

7779
function validateConstructorData(x: Decimal128Value): void {
78-
if ((x as NaNValue) !== undefined) {
79-
return; // no further validation needed
80-
}
81-
82-
if ((x as InfiniteValue) !== undefined) {
80+
if (x === "NaN" || x === "Infinity" || x === "-Infinity") {
8381
return; // no further validation needed
8482
}
8583

0 commit comments

Comments
 (0)