Proof of impossibility (or counterexample) for tan(x) = infinity, for floating-point values
The POSIX page of the tan function family (tan, tanf, tanl) in C says that: If the correct value would cause overflow, a range error shall occur and tan(), tanf(), and tanl() shall return ±HUGE_VAL, ±HUGE_VALF, and ±HUGE_VALL, respectively, with the same sign as the correct value of the function. However, in practice it is very difficult to actually obtain +∞ or −∞ as a computed result in such cases, since the floating-point number would need to be so close to an odd multiple of π/2 that its tangent would be larger than the maximum representable floating-point value of that type. Due to the sp
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.