rustils::parse::float
pub fn bool_to_f32(a: bool) -> f32
Parse bool to f32
bool
f32
If a is false then returns 0.0. If a is true then returns 1.0.
a
false
true
use rustils::parse::float::bool_to_f32; assert_eq!(bool_to_f32(true), 1.0_f32); assert_eq!(bool_to_f32(false), 0.0_f32);