Mail Archives: djgpp/1994/05/22/05:44:15
I have found a problem with tan(). When given an argument that is too
large (like 1e100), it gives a stack underflow exception. I expected
to get back a NaN, like I do with sin() and cos().
Below is an excerpt from /djgpp/libsrc/m/src/tan.s:
.globl _tan
_tan:
fldl 4(%esp)
fptan
fstsw
fstp %st(0)
sahf
jnp L1
fstp %st(0)
fldl L0
L1:
ret
Note that in the case of an exception, "fstp" is done twice. I'm not
fluent in 80x86 assembly, but I'd guess that the second "fstp" should
be removed. When I did this, my stack underflow went away.
--
Eric Backus
ericb AT lsid DOT hp DOT com
(206) 335-2495
- Raw text -