std-method

Floating-point min and max

Select extrema of readings. These methods ignore a single NaN operand, which may or may not match your missing-data policy. Expected stdout (not executed): 9 12 4 Common mistake: A valid maximum does not prove all readings were valid.

Formal Syntax & Structure

rust syntaxrust
x.min(y) -> f64; x.max(y) -> f64

Working Example

Example Snippetrust
fn main() {    println!("{} {}", 12.0_f64.min(9.0), 12.0_f64.max(9.0));    println!("{}", f64::NAN.max(4.0));}
Rust Reference