Skip to content

Number

Numeric utilities and conversions.


_INT32_MAX

Maximum value representable by a 32-bit signed integer.


_INT64_MAX

Maximum value representable by a 64-bit signed integer.


_INT32_MIN

Minimum value representable by a 32-bit signed integer.


_INT64_MIN

Minimum value representable by a 64-bit signed integer.


int32_to_float

Convert a 32-bit integer to a float.

int32_to_float : int32 -> floatint32_to_float : int32 -> float

int32_to_double

Convert a 32-bit integer to a double.

int32_to_double : int32 -> doubleint32_to_double : int32 -> double

int64_to_float

Convert a 64-bit integer to a float.

int64_to_float : int64 -> floatint64_to_float : int64 -> float

int64_to_double

Convert a 64-bit integer to a double.

int64_to_double : int64 -> doubleint64_to_double : int64 -> double

float_to_int32

Convert a float to a 32-bit integer.

float_to_int32 : float -> int32float_to_int32 : float -> int32

double_to_int32

Convert a double to a 32-bit integer.

double_to_int32 : double -> int32double_to_int32 : double -> int32

float_to_int64

Convert a float to a 64-bit integer.

float_to_int64 : float -> int64float_to_int64 : float -> int64

double_to_int64

Convert a double to a 64-bit integer.

double_to_int64 : double -> int64double_to_int64 : double -> int64

int32_to_int64

Convert a 32-bit integer to a 64-bit integer.

The value is sign-extended.

int32_to_int64 : int32 -> int64int32_to_int64 : int32 -> int64

int64_to_int32

Convert a 64-bit integer to a 32-bit integer.

The value is truncated; the result is implementation-defined if the value does not fit in 32 bits.

int64_to_int32 : int64 -> int32int64_to_int32 : int64 -> int32

parse_int32

Parse a decimal string into a 32-bit integer.

Returns None if parsing fails (invalid format or overflow), otherwise Some(int32).

parse_int32 : string -> Option<int32>parse_int32 : string -> Option<int32>

parse_int64

Parse a decimal string into a 64-bit integer.

Returns None if parsing fails (invalid format or overflow), otherwise Some(int64).

parse_int64 : string -> Option<int64>parse_int64 : string -> Option<int64>

parse_float

Parse a decimal string into a float.

Returns None if parsing fails (invalid format), otherwise Some(float).

parse_float : string -> Option<float>parse_float : string -> Option<float>

parse_double

Parse a decimal string into a double.

Returns None if parsing fails (invalid format), otherwise Some(double).

parse_double : string -> Option<double>parse_double : string -> Option<double>

parse_bignum

Parse a decimal string into a bignum.

Returns None if parsing fails, otherwise Some(bignum).

parse_bignum : string -> Option<bignum>parse_bignum : string -> Option<bignum>

bignum_to_float

Convert a bignum to a float.

bignum_to_float : bignum -> floatbignum_to_float : bignum -> float

bignum_to_double

Convert a bignum to a double.

bignum_to_double : bignum -> doublebignum_to_double : bignum -> double

bignum_to_string

Convert a bignum to its string representation.

bignum_to_string : bignum -> stringbignum_to_string : bignum -> string

max

Return the greater of two comparable values.

max : a -> a -> a with (Ordered<a>)max : a -> a -> a with (Ordered<a>)

maximum

Compute the maximum element of a list.

Returns None for an empty list.

maximum : List<a> -> Option<a> with (Ordered<a>)maximum : List<a> -> Option<a> with (Ordered<a>)

is_even

Test whether a number is even.

is_even : a -> bool with (Modulo<a>)is_even : a -> bool with (Modulo<a>)

is_odd

Test whether a number is odd.

is_odd : a -> bool with (Modulo<a>)is_odd : a -> bool with (Modulo<a>)