Float

64-bit Floating-point numbers

pi

Ratio of the circumference of a circle to its diameter.

let pi : Float

e

Base of the natural logarithm.

let e : Float

abs

Returns the absolute value of x.

let abs : (x : Float) -> Float

sqrt

Returns the square root of x.

let sqrt : (x : Float) -> Float

ceil

Returns the smallest integral float greater than or equal to x.

let ceil : (x : Float) -> Float

floor

Returns the largest integral float less than or equal to x.

let floor : (x : Float) -> Float

trunc

Returns the nearest integral float not greater in magnitude than x.

let trunc : (x : Float) -> Float

nearest

Returns the nearest integral float to x.

let nearest : (x : Float) -> Float

copySign

Returns x if x and y have same sign, otherwise x with negated sign.

let copySign : (x : Float, y : Float) -> Float

min

Returns the smaller value of x and y.

let min : (x : Float, y : Float) -> Float

max

Returns the larger value of x and y.

let max : (x : Float, y : Float) -> Float

sin

Returns the sine of the radian angle x.

let sin : (x : Float) -> Float

cos

Returns the cosine of the radian angle x.

let cos : (x : Float) -> Float

tan

Returns the tangent of the radian angle x.

let tan : (x : Float) -> Float

arcsin

Returns the arc sine of x in radians.

let arcsin : (x : Float) -> Float

arccos

Returns the arc cosine of x in radians.

let arccos : (x : Float) -> Float

arctan

Returns the arc tangent of x in radians.

let arctan : (x : Float) -> Float

arctan2

Given (y,x), returns the arc tangent in radians of y/x based on the signs of both values to determine the correct quadrant.

let arctan2 : (y : Float, x : Float) -> Float

exp

Returns the value of e raised to the x-th power.

let exp : (x : Float) -> Float

log

Returns the natural logarithm (base-e) of x.

let log : (x : Float) -> Float

format

Formatting. format(fmt, x) formats x to Text according to the formatting directive fmt, which can take one of the following forms: - #fix prec as fixed-point format with prec digits - #exp prec as exponential format with prec digits - #gen prec as generic format with prec digits - #hex prec as hexadecimal format with prec digits - #exact as exact format that can be decoded without loss.

func format(fmt : {#fix : Nat8; #exp : Nat8; #gen : Nat8; #hex : Nat8; #exact}, x : Float) : Text

toText

Conversion.

let toText : Float -> Text

toInt64

Conversion.

let toInt64 : Float -> Int64

fromInt64

Conversion.

let fromInt64 : Int64 -> Float

toInt

Conversion via Int64.

let toInt : Float -> Int

fromInt

Conversion via Int64. May trap.

let fromInt : Int -> Float

equal

Returns x == y.

func equal(x : Float, y : Float) : Bool

notEqual

Returns x != y.

func notEqual(x : Float, y : Float) : Bool

less

Returns x < y.

func less(x : Float, y : Float) : Bool

lessOrEqual

Returns x ⇐ y.

func lessOrEqual(x : Float, y : Float) : Bool

greater

Returns x > y.

func greater(x : Float, y : Float) : Bool

greaterOrEqual

Returns x >= y.

func greaterOrEqual(x : Float, y : Float) : Bool

compare

Returns the order of x and y.

func compare(x : Float, y : Float) : {#less; #equal; #greater}

neq

Returns the negation of x, -x .

func neq(x : Float) : Float

add

Returns the sum of x and y, x + y.

func add(x : Float, y : Float) : Float

sub

Returns the difference of x and y, x - y.

func sub(x : Float, y : Float) : Float

mul

Returns the product of x and y, x * y.

func mul(x : Float, y : Float) : Float

div

Returns the division of x by y, x / y.

func div(x : Float, y : Float) : Float

rem

Returns the remainder of x divided by y, x % y.

func rem(x : Float, y : Float) : Float

pow

Returns x to the power of y, x ** y.

func pow(x : Float, y : Float) : Float