Mail Archives: djgpp/2000/01/23/05:43:52
On 23 Jan 2000, Creed wrote:
> For example at an angle of 1.13 radians a test program finds to six decimal
> places:
> sin= 0.684014 cos = 0.878084 sin^2 + cos^2 = 1.238908 and tan= 0.935537
> The correct answers are:
> sin = 0.904413 cos = 0.426660 sin^2 + cos^2 = 1.000000 and tan= 2.119750
>
> I'm using djgpp version 2.8.1 and have djdev202, on a 486SX with no floating
> point processor, under Windows for Workgroups 3.11, in the DOS-box (MS-DOS
> 6.20).
One word: upgrade. The floating-point emulator in all DJGPP versions
before 2.03 had grave accuracy problems in trig functions in
particular and in other functions as well.
As a matter of fact, I'm surprised you can run your programs at all:
the emulator before v2.03 would hang under Windows 3.X for any
non-trivial FP program. Didn't you have strange cases where a program
seems to hang?
So please download and install djdev203.zip, rebuild your program, and
see if the problems go away.
> I believe I am using libemu.a (I never downloaded that WEMU thing.)
No, you don't ;-). First, to use libemu.a, you need to link with
the -lemu switch, which you didn't do. And second, there's a known
bug in djdev202, whereby even if you link with -lemu, the program uses
emu387.dxe instead, since some piece of the machinery that is required
to use the library was omitted from djdev202. Again, upgrade.
- Raw text -