[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Gcc: Conversion of NaN => int



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] []