| description | JavaScript-like elements in the global scope. |
|---|
In addition to low-level WebAssembly and compiler built-ins, the following global constants and functions are present alongside the standard library's classes.
-
const NaN: auto // f32 or f64
Not a number as a 32-bit or 64-bit float depending on context. Compiles to a constant.
-
const Infinity: auto // f32 or f64
Positive infinity as a 32-bit or 64-bit float depending on context. Compiles to a constant.
-
function isNaN<T>(value: T): bool
Tests if a 32-bit or 64-bit float is
NaN. -
function isFinite<T>(value: T): bool
Tests if a 32-bit or 64-bit float is finite, that is not
NaNor +/-Infinity. -
function parseInt(str: string, radix?: i32): i64
Parses a string to a 64-bit integer. Returns
0on invalid inputs. -
function parseFloat(str: string): f64
Parses a string to a 64-bit float. Returns
NaNon invalid inputs.