Date: Thu, 10 Jun 1999 10:44:13 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Scott Rohde cc: djgpp AT delorie DOT com Subject: Re: Linking in the math library produces peculiar results. In-Reply-To: <_3K63.2422$xg.109@firefly> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk 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.