4 ms·
I prefer the min/max-based definition for the same reason: Its easier to work out the edge cases around NaN and comparisons against NaN.
by brandmeyer 6y ago
I prefer the min/max-based definition for the same reason: Its easier to work out the edge cases around NaN and comparisons against NaN.
- cogman10 6y agoNaN always returns false on comparisons. So seems pretty straight forward that this would return NaN if NaN is passed in. That doesn't seem unreasonable. (In fact, that's what happens with the min/max approach).