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

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

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

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

The num crate is a deprecated mess.

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

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

1 Like

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

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.