Here is the simple question, I'm writing a function that returns max value of multiple floats, std::cmp::max
gives me:
the trait bound `{float}: std::cmp::Ord` is not satisfied
Do I need to write this for every project:
macro_rules! max {
($x: expr) => ($x);
($x: expr, $($z: expr),+) => {{
let y = max!($($z),*);
if $x > y {
$x
} else {
y
}
}}
}
So what is the recommended way to get max value of multiple floats?