Closed
Description
In tan(A), if A is one of the asymptote values (such as 90deg, 270deg, etc), the result must be +∞ for 90deg and all values a multiple of 360deg from that (such as -270deg or 450deg), and −∞ for -90deg and all values a multiple of 360deg from that (such as -450deg or 270deg).
Note: This is only relevant for units that can exactly represent the asymptotic values, such as deg or grad. rad cannot, and so whether the result is a very large negative or positive value can depend on rounding and precise details of how numbers are internally stored. It’s recommended you don’t depend on this behavior if using such units.
Given:
- At the time we evaluate the tan() function the engine usually has forgotten the original specified units (we do most of the calc math in canonical units).
- It makes the code slower for common cases, to handle a mathematically-undefined case.
- We already have the undefined result in the spec for radians.
- No engine implements this special-case afaict.
I'd prefer to remove the special-case for degrees here. Wdyt @tabatkins?