Mail Archives: djgpp/1999/06/10/03:48:19
On Mon, 7 Jun 1999, Scott Rohde wrote:
> The following test program, which uses the sine function, works as
> expected when compiled without the -lm option (I assume that means it
> is using a definition for sin(double) in libc.a). But with -lm, I get
> very peculiar results: for the integral (but not int!) values of x
> between x = 29.0 and x = 75.0, the value returned by the sine function
> for one of the four angles having x for a reference angle is off in
> all but eleven cases.
Thanks for a detailed and comprehensive report!
This problem is due to a subtle bug in the emulator that is triggered
by the elaborate argument-reduction algorithm in libm.a. I have fixed
the bug, and the fixed version will be part of the next DJGPP release.
If you need the fixed version now, mail me privately and I will send
you the corrected emulator.
> Whether or
> not I link in floating point emulation with the -lemu switch makes no
> difference in the program results.
This is normal: the emulator and libemu.a share the same code (and the
same bugs ;-).
In addition, libemu.a from v2.02 didn't include the modified
npxsetup.o module which sets things up so that the emulation is
handled by the linked-in functions instead of loading emu387.dxe. So
it's possible that your program linked with -lemu was still loading
the emulator at run time.
- Raw text -