delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/23/05:43:52

Date: Sun, 23 Jan 2000 10:50:02 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Creed <110370 DOT 3162 AT CompuServe DOT COM>
cc: djgpp AT delorie DOT com
Subject: Re: Trig Bug?
In-Reply-To: <86dv3p$p24$1@ssauraab-i-1.production.compuserve.com>
Message-ID: <Pine.SUN.3.91.1000123104928.26609e-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: dj-admin AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019