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

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
jessealama committed Jun 20, 2024
1 parent a0046da commit fb90e18
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/decimal128.mts
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,16 @@ type Decimal128Value = NaNValue | InfiniteValue | FiniteValue;
const NAN = "NaN";
const POSITIVE_INFINITY = "Infinity";
const NEGATIVE_INFINITY = "-Infinity";
const TEN_MAX_EXPONENT = new Rational(bigTen, bigOne).scale10(EXPONENT_MAX);
const TEN_MAX_EXPONENT = new Rational(bigTen, bigOne).scale10(
MAX_SIGNIFICANT_DIGITS
);

function pickQuantum(d: Rational, preferredQuantum: number): number {
return preferredQuantum;
}

function validateConstructorData(x: Decimal128Value): void {
if ((x as NaNValue) !== undefined) {
return; // no further validation needed
}

if ((x as InfiniteValue) !== undefined) {
if (x === "NaN" || x === "Infinity" || x === "-Infinity") {
return; // no further validation needed
}

Expand Down

0 comments on commit fb90e18

Please sign in to comment.