You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While fixing #4158, I stumbled across the fact that Math.hypot(Infinity, NaN) yields Infinity, and Math.pow(NaN, 0) yields 1 (both in spec and impl). These are the only two cases in the math functions I could find where NaN wasn't "infectious".
Do we want to carry this behavior along to CSS? Should we specify that NaN is specially handled in these functions? Or perhaps officially undefine it, allowing either "infectious" or "JS" behavior as valid?
The text was updated successfully, but these errors were encountered:
IMO the infectious behavior makes sense if when replacing each NaN argument with a variable (over non-NaN numbers), the resulting function is not constant.
But here hypot(+∞, x) must be +∞ no matter what x is, and pow(x, 0) must be 1. So extending this for NaN doesn't seem unreasonable. Though max(+∞, NaN) = NaN, so it's not much consistent.
Internal consistency seems more important than external compatibility indeed, so, in CSS, NaN needs to be infectious either always or never (if treatable).
While fixing #4158, I stumbled across the fact that
Math.hypot(Infinity, NaN)
yields Infinity, andMath.pow(NaN, 0)
yields 1 (both in spec and impl). These are the only two cases in the math functions I could find where NaN wasn't "infectious".Do we want to carry this behavior along to CSS? Should we specify that NaN is specially handled in these functions? Or perhaps officially undefine it, allowing either "infectious" or "JS" behavior as valid?
The text was updated successfully, but these errors were encountered: