Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
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	[thread overview]
Message-ID: <350D2C63.F3D241F4@voicenet.com> (raw)

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! */
}



             reply	other threads:[~1998-03-16 13:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-03-16 13:43 Uncle George [this message]
     [not found] <199803161451.GAA10632@cesium.transmeta.com>
1998-03-16 15:37 ` Gcc: Conversion of NaN => int Uncle George
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