Function datafusion_common::rounding::next_up
source · pub fn next_up<F: FloatBits + Copy>(float: F) -> F
Expand description
Returns the next representable floating-point value greater than the input value.
This function takes a floating-point value that implements the FloatBits trait, calculates the next representable value greater than the input, and returns it.
If the input value is NaN or positive infinity, the function returns the input value.
§Examples
use datafusion_common::rounding::next_up;
let f: f32 = 1.0;
let next_f = next_up(f);
assert_eq!(next_f, 1.0000001);