From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,17e99293e94a7e6f,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-31 02:25:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.ems.psu.edu!news.litech.org!eurocyber.net!newsfeed.muc.eurocyber.net!newsfeed.vmunix.org!fr.clara.net!heighliner.fr.clara.net!oleane.net!oleane!nnrp.oleane.net!not-for-mail From: "Jean-Pierre Rosen" Newsgroups: comp.lang.ada Subject: Another ammunition Date: Tue, 31 Dec 2002 11:23:02 +0100 Organization: Guest of France Telecom Oleane's newsreading service Message-ID: NNTP-Posting-Host: mailhost.axlog.fr X-Trace: s1.read.news.oleane.net 1041330170 14218 195.25.228.57 (31 Dec 2002 10:22:50 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Tue, 31 Dec 2002 10:22:50 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4920.2300 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4920.2300 Xref: archiver1.google.com comp.lang.ada:32404 Date: 2002-12-31T11:23:02+01:00 List-Id: I know I'm preaching to the choir, but here is another story Ada fans can tell to the other guys who say that "language doesn't matter"... My son was recently doing an assignment in C, which involved lots of floating point computations, and he kept getting inconsistent results. After lots of searching, he discovered that NaNs were generated in various places. There seemed to be no consistency in the appearing of NaNs: changing optimization options, adding intermediate variables in computations, etc. all changed the way NaNs were produced. Here is what happened: A C function was returning a float, but in some place was declared as returning an int. In gcc, a function that returns a float leaves the result on the coprocessor stack, NOT on the regular stack. Therefore, the return value of the function was not popped off the coprocessor stack. And when the coprocessor's stack is full, every floating point operation results in NaN.... It took a week to understand what was happenning. Would not have passed the first compilation in Ada. FWIW... -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr