Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
next_down in datafusion::common::rounding - Rust
[go: Go Back, main page]

Function next_down

Source
pub fn next_down<F>(float: F) -> F
where F: FloatBits + Copy,
Expand description

Returns the next representable floating-point value smaller than the input value.

This function takes a floating-point value that implements the FloatBits trait, calculates the next representable value smaller than the input, and returns it.

If the input value is NaN or negative infinity, the function returns the input value.

ยงExamples

use datafusion_common::rounding::next_down;

let f: f32 = 1.0;
let next_f = next_down(f);
assert_eq!(next_f, 0.99999994);