[−][src]Function surreal::stof
pub fn stof(sur: &Surreal) -> f32
Converts a surreal number (with non-infinite sets) into a floating-point number.
Panics
Given that all surreal numbers with non-infinite sets match to a finite binary representable
number, this function covers all possible values of Surreal
and will not panic.
Examples
let zero = surreal::Surreal::new(vec![], vec![]); let one = surreal::Surreal::new(vec![&zero], vec![]); assert!(surreal::stof(&zero) == 0.0); assert!(surreal::stof(&one) == 1.0);