From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by listman.redhat.com (Postfix) with ESMTP id 0B9663F6F8 for ; Mon, 2 Dec 2002 19:14:05 -0500 (EST) Received: (from mail@localhost) by int-mx1.corp.redhat.com (8.11.6/8.11.6) id gB30E4w29353 for axp-list@listman.redhat.com; Mon, 2 Dec 2002 19:14:04 -0500 Received: from mx1.redhat.com (mx1.redhat.com [172.16.48.31]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with SMTP id gB30E4D29349 for ; Mon, 2 Dec 2002 19:14:04 -0500 Received: from skarpsey.dyndns.org (12-237-135-160.client.attbi.com [12.237.135.160]) by mx1.redhat.com (8.11.6/8.11.6) with SMTP id gB2NnAP31904 for ; Mon, 2 Dec 2002 18:49:10 -0500 Received: from valhalla (Valhalla.attbi.com [192.168.0.2]) by skarpsey.dyndns.org (8.12.6/8.12.5) with ESMTP id gB308Slm016303 for ; Mon, 2 Dec 2002 18:08:28 -0600 Content-Type: text/plain; charset="iso-8859-1" From: Kelledin To: axp-list@redhat.com Subject: Re: is this feature documented? Date: Mon, 2 Dec 2002 18:08:28 -0600 User-Agent: KMail/1.4.3 References: In-Reply-To: MIME-Version: 1.0 Message-Id: <200212021808.28428.kelledin+AXP@skarpsey.dyndns.org> Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by int-mx1.corp.redhat.com id gB30E4D29349 X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0.1 Precedence: bulk Reply-To: axp-list@redhat.com List-Help: List-Post: List-Subscribe: , List-Id: Linux and Red Hat on Alpha processors List-Unsubscribe: , List-Archive: On Monday 02 December 2002 05:36 pm, Andrew A. Gill wrote: > I was working with Kai Sterker (well, asking for help) on a > floating point exception in the Adonthell program, when she > noticed this interesting feature: > > [superluser@trystero superluser]$ cat fpe.cc > #include > > int main(void) > { > int x = (int) (4/(float)0); > printf ("x = %i\n", x); > } > > [superluser@trystero superluser]$ g++ fpe.cc > fpe.cc: In function `int main()': > fpe.cc:5: warning: division by zero in `4 / 0.' > [superluser@trystero superluser]$ ./a.out > x = 0 > > This is gcc version 3.2 20021115 (Red Hat Linux 8.0 3.2-14). > Should this be normal behavior? Is this the expected output > of standard C++? I've seen things like this before; it's usually the developer's way of obtaining a bitwise IEEE754 representation of positive infinity (otherwise represented as macro HUGE_VAL or INFINITY from math.h). I don't know what the developer was trying to do here, though. The code behaves the same way on my system (ev56) as it does on yours, and I'm pretty sure my compiler is solid (gcc-3.2 release with a few bugfix patches). So I would expect you're getting the correct output. -- Kelledin "If a server crashes in a server farm and no one pings it, does it still cost four figures to fix?"