Re: [csswg-drafts] [css-values] Does tan(90deg) return +∞, −∞ or NaN? (#4101)

Interesting question!

I agree that, at minimum, tan(90deg) should equal +inf. Since JS's Math.PI *slightly* undershoots the precise value, it happens to be true that `Math.tan(Math.PI/2 * N)` is always a very large (near infinite) positive value when N is a positive odd number, and a very large negative value when N is a negative odd. (But of course, adding a *very tiny* additional nudge will shift it over the threshold and swap the sign.) 

So at least it's consistent with *naive* usage of JS to say that positive angles give +inf and negative give -inf. ^_^ And then yeah, that gives you roundtripping of either nesting (within the [-90deg, 90deg] range).

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4101#issuecomment-511032159 using your GitHub account

Received on Friday, 12 July 2019 21:01:52 UTC