delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/20/22:24:21

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Round off errors
Date: Fri, 20 Feb 1998 18:44:09 -0500
Organization: Two pounds of chaos and a pinch of salt.
Lines: 19
Message-ID: <34EE1549.6063@cs.com>
References: <01bd3e0c$200881c0$LocalHost AT alfredoc>
NNTP-Posting-Host: ppp231.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Alfredo J. Cole wrote:
> 
> Compiling the following code with DJGPP gives the erroneous result
> (5551.20). The same code compiled with Borland's bcd class gives the
> correct result (5551.22). I am developing an accounting system with
> DJGPP and it requires that the results be exact. Is there a similar
> class or option under DJGPP that will eliminate these round off
> errors?

Make sure that you are linking in the math library (-lm), which contains
improved-accuracy versions of the standard libc math functions.

-- 
---------------------------------------------------------------------
|      John M. Aldrich       | "If 'everybody knows' such-and-such, |
|       aka Fighteer I       | then it ain't so, by at least ten    |
|   mailto:fighteer AT cs DOT com   | thousand to one."                    |
| http://www.cs.com/fighteer |                 - Lazarus Long       |
---------------------------------------------------------------------

- Raw text -


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