Skip to main content

Module int

Module int 

Source
Expand description

Lean’s Int: an integer of any size.

An integer that fits 32 bits is stored in the pointer bits; anything else is the same heap object a large Nat uses, with a sign. As in lean.h, arguments are borrowed and results are owned unless noted.

Functions§

float_scaleb⚠
a * 2^b.
int8_of_int⚠
An Int reduced to a fixed width, as its bits.
int8_to_int
A fixed-width signed integer, given as its bits, as an Int.
int16_of_int⚠
int16_to_int
int32_of_int⚠
int32_to_int
int64_of_int⚠
int64_to_int_sint
int_add⚠
int_dec_eq⚠
int_dec_le⚠
int_dec_lt⚠
int_dec_nonneg⚠
int_div⚠
Division rounding toward zero; zero when the divisor is zero.
int_div_exact⚠
int_ediv⚠
Euclidean division: the remainder is never negative. Zero when the divisor is zero.
int_emod⚠
The remainder of Euclidean division; the dividend when the divisor is zero.
int_mod⚠
Remainder with the sign of the dividend; the dividend when the divisor is zero.
int_mul⚠
int_neg⚠
int_neg_succ_of_nat⚠
-(n + 1) for a Nat n. Consumes n.
int_sub⚠
int_to_nat⚠
A non-negative Int as a Nat. Consumes a.
isize_of_int⚠
isize_to_int
nat_abs⚠
The absolute value, as a Nat.
nat_to_int⚠
A Nat as an Int. Consumes a.