Function to_fixed
Source pub fn to_fixed(x: f32) -> Fixed
Expand description
Converts a float value to Q15 fixed-point format.
x: A floating-point value in the range [-1.0, 1.0]
§Output
A Fixed value representing the input in Q15 format.
§Example
ⓘuse fixed_math_taylor::to_fixed;
let f = to_fixed(0.5);
assert_eq!(f, 16384);