spinoso_math

Function ldexp

Source
pub fn ldexp(fraction: f64, exponent: i32) -> Result<f64, NotImplementedError>
Expand description

Returns the value of fraction * (2**exponent).

§Examples

use spinoso_math as math;
let (fraction, exponent) = math::frexp(1234.0)?;
let float = math::ldexp(fraction, exponent)?;
assert_eq!(float, 1234.0);

§Errors

Because spinoso-math was built with the full feature, this function will always succeed and return the float determined by the given fraction and exponent.