pub fn f32_to_bool(a: f32) -> bool
Parse f32
to
bool
If a
is 0 then returns false
,
otherwise true
.
use rustils::parse::boolean::f32_to_bool;
let a = 42.0_f32;
let b = -1.0_f32;
let c = 0.0_f32;
assert!(f32_to_bool(a));
assert!(f32_to_bool(b));
assert!(!f32_to_bool(c));