pub fn to_fixed(x: f64, m: i32, n: i32) -> Result<(u128, bool), String>
Expand description

Convert x (f64) into fixed point format (Qm.n), if possible.

use fixed2float::to_fixed;
assert_eq!(to_fixed(1.5, 1, 3).unwrap(), (0b1100, true));