I was looking at std::numeric_limits
but it appears \'min()\' returns the smallest absolute value, not the lowest value. Is it safe
Yes, float
is symmetric in minimum/maximum values.
If you're using the lowest representable value as an initial value in searching a list for its maximum value, consider using infinity instead.
std::numeric_limits
will return true
for any numeric type that has it and std::numeric_limits
will return a value that always evaluates greater than any other non-NaN value for that type. This value can be negated and will evaluate less than anything else.