4 ms·
Absolutely. With the above implementation, I can see exactly what's going on, with the others, I'm trying to work out potential edge cases.
by mywittyname 6y ago
Absolutely. With the above implementation, I can see exactly what's going on, with the others, I'm trying to work out potential edge cases.
- brandmeyer 6y agoI 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).