menu

Number

import { Number } from "destack:math";

Number constants and parsing functions.

language/library/src/math/number.ds:104:195
1export class Number {2    EPSILON: float64;3    MAX_VALUE: float64;4    MIN_VALUE: float64;5    MAX_SAFE_INTEGER: float64;6    MIN_SAFE_INTEGER: float64;7    POSITIVE_INFINITY: float64;8    NEGATIVE_INFINITY: float64;9    NaN: float64;10    toString(radix?: float64 | undefined): Cow<"frame", string>;11    toFixed(fractionDigits?: float64 | undefined): Cow<"frame", string>;12    toExponential(fractionDigits?: float64 | undefined): Cow<"frame", string>;13    toPrecision(precision?: float64 | undefined): Cow<"frame", string>;14    toLocaleString(locales?: string | string[] | undefined, options?: NumberFormatOptions | undefined): Cow<"frame", string>;15    valueOf(): float64;16    static isFinite(value: unknown): boolean;17    static isInteger(value: unknown): boolean;18    static isNaN(value: unknown): boolean;19    static isSafeInteger(value: unknown): boolean;20    static parseFloat(text: string): float64;21    static parseInt(text: string, radix?: float64 | undefined): float64;22}

Members

EPSILON: float64

Difference between 1 and the next representable float64 value.

MAX_VALUE: float64

The largest finite float64 value.

MIN_VALUE: float64

The smallest positive float64 value.

MAX_SAFE_INTEGER: float64

The largest exactly representable integer in a float64.

MIN_SAFE_INTEGER: float64

The smallest exactly representable integer in a float64.

POSITIVE_INFINITY: float64

Positive infinity.

NEGATIVE_INFINITY: float64

Negative infinity.

NaN: float64

Not-a-number.

toString(radix?: float64 | undefined): Cow<"frame", string>

Return this number as a string.

toFixed(fractionDigits?: float64 | undefined): Cow<"frame", string>

Return this number in fixed-point notation.

toExponential(fractionDigits?: float64 | undefined): Cow<"frame", string>

Return this number in exponential notation.

toPrecision(precision?: float64 | undefined): Cow<"frame", string>

Return this number with the requested precision.

toLocaleString(locales?: string | string[] | undefined, options?: NumberFormatOptions | undefined): Cow<"frame", string>

Return this number as a locale-aware string.

valueOf(): float64

Return the primitive number value.

static isFinite(value: unknown): boolean

Return whether value is finite.

static isInteger(value: unknown): boolean

Return whether value is an integer.

static isNaN(value: unknown): boolean

Return whether value is NaN.

static isSafeInteger(value: unknown): boolean

Return whether value is exactly representable as an integer.

static parseFloat(text: string): float64

Parse a float64 from text.

static parseInt(text: string, radix?: float64 | undefined): float64

Parse an integer from text.