Date: Sun, 13 Nov 1994 10:34:09 +1100 From: Bill Metzenthen Subject: Re: DJGPP & MATH To: djgpp AT sun DOT soe DOT clarkson DOT edu Andras Solyom ("solyom AT bmeik DOT eik DOT bme DOT hu") wrote: >As I read much about floating point errors in GCC 1.12 or 1.11 nowdays, >maybe it is worthwile to report about my experinences. >I was given a C program written by Steven Pemberton (steven.cwi.nl) >which tests the capabilities of a C compiler. The copy I have is of Ver. 4.2. >I compiled and run it succesfully with TURBO C and C++ (Version 1.0 -2.0), >BORLAND C++ (Version 3.0, 3.1 and 4.0) compilers AND with DJGPP 1.09. >I switched on DJGPP 1.11 maint 5 a while ago and now it occured to me that >I gave the new compiler a test, and found out that it just crashes as you see: > then Aaron Ucko ("UCKO AT VAX1 DOT ROCKHURST DOT EDU") followed with: >Never mind; I ran across the latest version (5.0) and decided to try it >myself. It also crashes under DJGPP, but at a _much_ more sensible place: >when trying to divide by 0 (although it should have triggered a trap rather >than a floating point exception...) What's _really_ interesting is that > Every now and then someone gets one of these test programs, runs it, and then proclaims that they have discovered a bug in the floating point code of gcc. Usually (if not always?), the fault is found to lie in the test program. The code produced by gcc is not perfect but, as far as I know, it doesn't have any of the obvious bugs which these programs purport to test for. It is quite difficult to make a good floating point test program. The problem is that there are a lots of possible gotchas allowable in 'C' when you try to test the margins. Probably the best program which I have seen is `paranoia' (available on netlib). It doesn't crash, but will report that the floating point has one(*) flaw (paranoia is wrong). This venerated program is very good but not perfect. (*) You may find that it reports more flaws or errors if you use a floating point emulator other than wmemu1xx. --Bill