Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: "Andrew A. Gill" <superluser@mail.isc.rit.edu>
To: AXP-list <axp-list@redhat.com>
Subject: is this feature documented?
Date: Mon, 2 Dec 2002 18:36:39 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.44.0212021828310.26163-100000@res104a-017.rh.rit.edu> (raw)

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 <stdio.h>

	    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++?

-- 
|Andrew A. Gill                       |I posted to Silent-Tristero and|
|<superluser@mail.rit.edu>            |all I got was this stupid sig! |
|alt.tv.simpsons CBG-FAQ author       |                               |
|                          (Report all obscene mail to Le Maitre Pots)|
|Nothing here yet: <http://www.needsfoodbadly.com>    Temporary sig: --

Could be less broken...




             reply	other threads:[~2002-12-02 23:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-02 23:36 Andrew A. Gill [this message]
2002-12-03  0:08 ` is this feature documented? Kelledin
2002-12-03  8:20   ` Andrew A. Gill
2002-12-03  7:36 ` Falk Hueffner
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox