rustils::parse::double
pub fn bool_to_f64_res(a: bool) -> ParseResultF64
Parse bool to f64
bool
f64
If a is false then returns Ok(0.0). If a is true then returns Ok(1.0).
a
false
Ok(0.0)
true
Ok(1.0)
use rustils::parse::double::bool_to_f64_res; assert_eq!(bool_to_f64_res(true), Ok(1.0_f64)); assert_eq!(bool_to_f64_res(false), Ok(0.0_f64));