Why `f32` and `f64` do not have `min_value/max_value` methods?


#1

In std, all primitive integer types have min_value() and max_value() methods, whereas f32 and f64 do not. Are there some special considerations?


#2

f32 and f64 aren’t integer. Their respective minimum and maximum values are infinity and -infinity, respectively.


#3

But the Float trait in the crate num have these two methods and min_positive_value().


#4

The num crate is a deprecated mess.

(min_positive_value is also a different thing… it’s like the smallest number larger than 0)


#5

Did you just say that infinity is the minimum and -infinity is the maximum?


#6

Of course it’s the other way round. Infinity is the maximum and negative infinity the minimum.