2 ms·
> Both min and max should return NaN, if any of their parameters is NaN. That's not a given, though. IEEE 754-2008 defined min and max as returning the non-NaN
by noctune 6y ago
> Both min and max should return NaN, if any of their parameters is NaN.
That's not a given, though. IEEE 754-2008 defined min and max as returning the non-NaN parameter. They have been removed in IEEE 754-2019 though.
- xxs 6y agoThe reference to IEEE 754 is made later on, mostly to answer the question posted. I meant regular functions in C alike languages - Math.min/max - java/javascript, fmin/fmax - C++. They do the "right" thing to propagate the NaN