This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gfortran] patch for PR 15292 missing round and roundf


On Mon, Jun 14, 2004 at 12:52:41PM +0200, Paolo Bonzini wrote:
> >(2) We can include a implementation of fpclassify().  I don't have 
> >    such code.
> 
> if (x != x) can be used to check for NaN.
> 
> if (x - x != 0.0) can be used to check for NaN or infinity.
> 
> if (x + x == x) can be used to check for infinity or zero.

Isn't fpclassify supposed not to generate any exceptions though?
The second test will generate invalid exception while fpclassify
will not (plus if one of the arguments is sNaN all 3 will throw
exception while sNaN will not.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]