Skip to main content

Module num

Module num 

Expand description

Explicit numeric conversions used at UI/model boundaries.

Keeping the necessarily lossy casts here makes their policy consistent: integer narrowing and signed-to-unsigned conversions saturate instead of wrapping, while geometry conversions use Rust’s saturating float-to-int semantics. Call sites stay readable without scattering lint exceptions.

Functions§

f32_of_f64
f32_of_i64
f32_of_u32
f32_of_usize
f64_of_i64
f64_of_u64
f64_of_usize
i32_of_f64
i32_of_usize
i64_of_f32
i64_of_f64
i64_of_usize
isize_of_usize
u8_of_f64
u8_of_i64
u32_of_f64
u32_of_i64
u32_of_usize
usize_of_f64
usize_of_i32
usize_of_i64
usize_of_isize