From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA23875 for caml-red; Fri, 13 Oct 2000 16:05:24 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA23164 for ; Fri, 13 Oct 2000 15:54:20 +0200 (MET DST) Received: from mrwall.kal.com (mrwall.kal.com [194.193.14.236]) by concorde.inria.fr (8.10.0/8.10.0) with SMTP id e9DDsJD15904 for ; Fri, 13 Oct 2000 15:54:20 +0200 (MET DST) Received: from mrwall.kal.com [194.193.14.236] (HELO localhost) by mrwall.kal.com (AltaVista Mail V2.0J/2.0J BL25J listener) id 0000_0050_39e7_1438_6890; Fri, 13 Oct 2000 14:55:04 +0100 Received: from somewhere by smtpxd Message-ID: <3145774E67D8D111BE6E00C0DF418B6631EE94@nt.kal.com> From: Dave Berry To: Pierre Weis Subject: RE: Undefined evaluation order Date: Fri, 13 Oct 2000 14:56:50 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.0.1460.8) Content-Type: text/plain; charset="iso-8859-1" Sender: weis@pauillac.inria.fr David, Thanks for your reply. Are you saying that if (a * b) would result in a NaN then you always want (a * b * 0.0) to return a NaN, so that you are aware of the potential problem? Dave. > -----Original Message----- > From: David McClain [mailto:dmcclain@azstarnet.com] > Sent: Thursday, October 12, 2000 6:06 PM > To: caml-list@inria.fr > Subject: Re: Undefined evaluation order > > > ... but the same would be true the other way too... (0.0 * a * b). I am a > numeric programmer and these things are unavoidable no matter how you choose > to order the evaluations. > > If (a * b) raises a NaN then what would be the value of 0.0 times that? The > IEEE spec would say the result would have to continue to be a NaN. > > I normally perform all arithmetic with exception processing supressed or > deferred. The only time an exception is useful to me is if there is some > remedial action that could be taken. I want my NaN's and INF's to appear in > my answers. In particular, if something should go awry at one point out of > millions I don't want that one point to hose my entire calculation. (Note > that I do not look kindly at the Fortran way of aborting an entire program > for one bad point...) In signal and image processing, especially in a > real-time environment, you just drop the bad points on the floor and > continue running. > > - DM