Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* is this feature documented?
@ 2002-12-02 23:36 Andrew A. Gill
  2002-12-03  0:08 ` Kelledin
  2002-12-03  7:36 ` Falk Hueffner
  0 siblings, 2 replies; 4+ messages in thread
From: Andrew A. Gill @ 2002-12-02 23:36 UTC (permalink / raw)
  To: AXP-list

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




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-12-03  8:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-02 23:36 is this feature documented? Andrew A. Gill
2002-12-03  0:08 ` Kelledin
2002-12-03  8:20   ` Andrew A. Gill
2002-12-03  7:36 ` Falk Hueffner

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