[][src]Function rustils::parse::boolean::f64_to_bool

pub fn f64_to_bool(a: f64) -> bool

Parse f64 to bool

If a is 0 then returns false, otherwise true.

Arguments

  • a - Any f64 number

Examples

use rustils::parse::boolean::f64_to_bool;

let a = 42.0_f64;
let b = -1.0_f64;
let c = 0.0_f64;

assert!(f64_to_bool(a));
assert!(f64_to_bool(b));
assert!(!f64_to_bool(c));