Int8

8-bit signed integers with checked arithmetic

Most operations are available as built-in operators (1 + 1).

toInt

Conversion.

let toInt : (Int8) -> Int

fromInt

Conversion. Traps on overflow/underflow.

let fromInt : (Int) -> Int8

toText

Returns the Text representation of x.

func toText(x : Int8) : Text

abs

Returns the absolute value of x. Traps when x = -2^7.

func abs(x : Int8) : Int8

min

Returns the minimum of x and y.

func min(x : Int8, y : Int8) : Int8

max

Returns the maximum of x and y.

func max(x : Int8, y : Int8) : Int8

equal

Returns x == y.

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

notEqual

Returns x != y.

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

less

Returns x < y.

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

lessOrEqual

Returns x ⇐ y.

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

greater

Returns x > y.

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

greaterOrEqual

Returns x >= y.

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

compare

Returns the order of x and y.

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

neg

Returns the negation of x, -x. Traps on overflow.

func neg(x : Int8) : Int8

add

Returns the sum of x and y, x + y. Traps on overflow.

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

sub

Returns the difference of x and y, x - y. Traps on underflow.

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

mul

Returns the product of x and y, x * y. Traps on overflow.

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

div

Returns the division of x by y, x / y. Traps on division by zero.

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

rem

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

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

pow

Returns x to the power of y, x ** y. Traps on overflow.

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