Skip to main content

float_to_fix

Function float_to_fix 

Source
pub fn float_to_fix() -> extern "C" fn(v: f32, n: i32) -> i32
Expand description

Convert a float to a signed fixed point integer reprsentation where n specifies the position of the binary point in the resulting fixed point representation. e.g. float_to_fix(0.5, 16) == 0x8000. This method rounds towards -INFINITY, and clamps the resulting integer to lie within the range -800000000 to 0x7FFFFFFF.