www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/15/12:05:27

To: eliz AT is DOT elta DOT co DOT il
Cc: djgpp AT delorie DOT com
References: <Pine DOT SUN DOT 3 DOT 91 DOT 981014173235 DOT 10409A-100000 AT is>
Message-Id: <ADrWX9sOVH@pauzner.mccme.ru>
From: "Leonid Pauzner" <uue AT pauzner DOT mccme DOT ru>
Date: Thu, 15 Oct 1998 19:43:49 +0400 (MSD)
X-Mailer: dMail [Demos Mail for DOS v2.07a5]
Subject: Re: Floating Point emulation problem
Lines: 21
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

> 11.6 Floating point inaccuracies when using emulator
> ====================================================

> **Q*: I am experiencing inaccurate results in some floating point
> calculations, sometimes in the 2nd or 3rd significant digit (like getting
> 118.401 instead of 120.0).  This is really unacceptable!  (And no, I'm *not*
> using a buggy Pentium CPU.)*

> *A*:  Are you using the emulator?  If so, it might be that the emulator isn't
> as accurate as you expect.  One particular known problem is that it does a
> bad job when computing the `atan' function.  So if you use `atan(1.)' to get
> the value of `Pi', that might be your problem.  Solution: make `Pi' a
> constant, as God intended.  The header file `<math.h>' includes the constant
> `M_PI' which you can use; or get the value of Pi from the net
> (http://www.diku.dk/~terra/pi.html).

Another solution to use WMEMU emulator that known to hold 7 significant digits
for `float' (but fails for `double'). To try the difference just download
wmemu binary package and set environment EMU387=path_to_wmemu\wmemu387.dxe




- Raw text -


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