From: Larry Estep Subject: Re: Math/rounding errors? To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii) (Eli Zaretskii) Date: Wed, 31 May 95 13:05:31 EDT Cc: djgpp AT sun DOT soe DOT clarkson DOT edu Mailer: Elm [revision: 70.85.2.1] > > > For instance, passing 5.0 to the function should result in a value > > of 120.0. Instead I get 118.401 from the djgpp version. This is just > > not acceptable. > > The code for the function is fairly simple. It involves a few > > multiplications and divisions, and one call to exp(). There are no > > iterative loops to build up roundoff errors. And even if there were, > > I wouldn't expect it to be this severe. > > Why not post the code? It's usually very hard (at least for some of us) > to second-guess a code without seeing it. Because I suspected it was a configuration problem. I was expecting someone to recommend a compiler option, an upgraded library, etc. As it turns out, the problem was that I was using the floating point emulator, which leaves something to be desired as far as precision goes. I think I remember reading something about this when I installed djgpp some time ago on my old 386. Evidently I'd never done anything that was math-intensive enough to show the limits of the emulator. Fortunately, I upgraded to a top-end 486 a couple months ago, so I no longer need the emulator. Thanks to all the folks who took the time to reply. Especially Morten Welinder, who correctly identified the problem. Larry P.S. No, I wasn't trying this on a Pentium. Although I was amused at how many responses I got asking about this. :)