Skip to main content

Module scalar

Module scalar 

Source
Expand description

Fixed-width integers, Bool and floats: Lean’s unboxed scalar types.

In Lean’s IR a value of UIntN, IntN, Char or Bool is an unsigned machine integer; the signed types reinterpret the same bits. The functions here therefore take and return unsigned integers, as the C runtime does, and match its results bit for bit: division by zero yields zero, a remainder by zero yields the dividend, shift amounts wrap at the bit width, and float-to-integer conversions saturate with NaN mapped to zero.

Modules§

bool
float
float32
int8
int16
int32
int64
isize
uint8
uint16
uint32
uint64
usize

Functions§

resolve
Resolves the name of a C runtime function, such as lean_uint32_shift_left, to the Rust path of its port relative to this crate, such as scalar::uint32::shift_left.