[][src]Function rustils::parse::float::bool_to_f32

pub fn bool_to_f32(a: bool) -> f32

Parse bool to f32

If a is false then returns 0.0.
If a is true then returns 1.0.

Arguments

Examples

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);