Branded numeric type specifically for Number.POSITIVE_INFINITY.
Number.POSITIVE_INFINITY
const isPosInfinity = (x: number): x is POSITIVE_INFINITY => x === Number.POSITIVE_INFINITY;const handleLimit = (x: number): FiniteNumber | POSITIVE_INFINITY => { if (x > Number.MAX_VALUE) return Number.POSITIVE_INFINITY as POSITIVE_INFINITY; return x as FiniteNumber;}; Copy
const isPosInfinity = (x: number): x is POSITIVE_INFINITY => x === Number.POSITIVE_INFINITY;const handleLimit = (x: number): FiniteNumber | POSITIVE_INFINITY => { if (x > Number.MAX_VALUE) return Number.POSITIVE_INFINITY as POSITIVE_INFINITY; return x as FiniteNumber;};
Branded numeric type specifically for
Number.POSITIVE_INFINITY.