From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 18067 invoked from network); 28 Nov 1998 14:08:35 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 28 Nov 1998 14:08:35 -0000 Received: from mailsrv.orgabelle.de (8@[195.243.123.163]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id JAA01381 for ; Sat, 28 Nov 1998 09:07:21 -0500 Received: (from mail@localhost) by mailsrv.orgabelle.de (8.8.7/) id OAA27647 for ; Sat, 28 Nov 1998 14:47:04 +0100 Received: from mail.bcas.de(172.20.225.71) by mailsrv.bcas.de via smap (V2.0) id xma027643; Sat, 28 Nov 98 14:46:20 +0100 Received: from apollo.bcas.de (apollo.bcas.de [172.20.213.2]) by mail.bcas.de (8.8.0/) with SMTP id PAA06864 for ; Sat, 28 Nov 1998 15:06:34 +0100 (MET) From: Heinz Ulrich Stille To: axp-list@redhat.com Subject: Re: Floating point problems Date: Sat, 28 Nov 1998 14:58:51 +0100 X-Mailer: KMail [version 0.7.9] Content-Type: text/plain References: <366007B6.205A50C0@neuro.uni-oldenburg.de> MIME-Version: 1.0 Message-Id: <98112815063308.07172@apollo.bcas.de> Content-Transfer-Encoding: 8bit Hi! On Sat, 28 Nov 1998, Johannes G.D. Hausmann wrote: >> main() { >> double x = 1.0; >> x *= 1e-310; >> } >> > >This is a denormal. From float.h: > > /* Minimum normalised double */ >#undef DBL_MIN >#define DBL_MIN 2.2250738585072014e-308 This does not seem to be the problem: I get the same results with double a = 1.0, b = 1e-310, c = a * b; printf("%lg\n", c): This gives `1e-310' on intel, but an error on alpha. OTOH, might it be related to storing the value? I get the same error with { double a = 1e-310; float b = a; }, instead of zero like on intel, but I get no error when I switch the values around in the first example (didn't check wheter the compiler is cheating and am away from my alpha at the moment). MfG, Ulrich -- "Never trust any ruler who puts his faith in tunnels and bunkers and escape routes. The chances are that his heart isn't in the job." T. Pratchett, "Guards! Guards!"