[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Gcc: Conversion of NaN => int
- From: Uncle George <gatgul voicenet com>
- To: "axp-list redhat com" <axp-list redhat com>
- Cc: "redhat-devel-list redhat com" <redhat-devel-list redhat com>
- Subject: Gcc: Conversion of NaN => int
- Date: Mon, 16 Mar 1998 08:43:00 -0500
this simple routine gives a floating point exception on my alpha/LX. it
doesn't help if u use the -mieee switch.
APARENTLY float conversion instructions are not SOFTWARE TRAPED!!!
this same routine does not give a SIGFPE on a 386 box, but if u examine
"i" u will see
that there is an 0x80000000 there ( where i expected a 0 ).
Are there ieee float rules for convertint NAN/INF float/doubles to
long/int?
gat
main()
{
float f, a,b;
int i;
a = 0.; b = 0.;
f = a/b; /* f = NaN */
i = (int)f; /* Conversion gets SIGFPE! */
}
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[]