# Number
Wrappers for basic numerical values.
The Number object has been split into one class per basic WebAssembly type as well. Unlike in JavaScript, these classes cannot have actual instances, hence it works a bit different than JavaScript's (MDN (opens new window)).
# Integers
The name Number below stands for one of the wrappers I8, I16, I32, I64, U8, U16, U32 or U64 representing their respective basic integer type T.
# Static members
const MIN_VALUE: TThe smallest representable value of the respective basic type. Differs from floating point values where it is the smallest representable positive value.
const MAX_VALUE: TThe largest representable value of the respective basic type.
function parseInt(value: string, radix?: i32): TParses a string to a value of the respective basic type.
# Instance members
- Returns the respective basic value converted to a string.
function toString(radix?: i32): string
# Floats
The name Number below stands for one of the wrappers F32 or F64 representing their respective basic floating point type T.
# Static members
const EPSILON: TThe difference between
1.0and the smallest number larger than1.0.const MAX_VALUE: TThe largest representable positive value by the respective basic type.
const MIN_VALUE: TThe smallest representable positive value by the respective basic type.
const MAX_SAFE_INTEGER: TThe largest safe integer representable by the respective basic type.
const MIN_SAFE_INTEGER: TThe smallest safe integer representable by the respective basic type.
const POSITIVE_INFINITY: TPositive infinity of the respective basic type.
const NEGATIVE_INFINITY: TNegative infinity of the respective basic type.
const NaN: TNaN (Not A Number) of the respective basic type.
function isNaN(value: T): boolTests if the value is
NaN.function isFinite(value: T): boolTests if the value is finite, that is not
NaN,POSITIVE_INFINITYorNEGATIVE_INFINITY.function isInteger(value: T): boolTests if the value is an integer.
function isSafeInteger(value: T): boolTests if the value is a safe integer.
function parseInt(value: string, radix?: i32): TParses a string to an integer value of the respective basic type.
function parseFloat(value: string): TParses a string to a float value of the respective basic type.
# Instance members
- Returns the respective basic value converted to a string. The
function toString(radix?: i32): stringradixparameter is currently ignored here.