This is the mail archive of the gcc@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: not-a-number's


On 2013-01-16 12:47:46 +0100, Mischa Baars wrote:
> On 01/16/2013 12:07 PM, Andrew Haley wrote:
> >Comparisons with NaN don't terminate a statement, and they don't
> >return a NaN.  They return a boolean.
> They shouldn't return anything, the comparison should be terminated.

This depends on the comparison and the context. You have quiet and
signaling comparisons. != and == are quiet comparisons: they never
generate an exception on quiet NaN operands. <, <=, >=, > are
signaling comparisons: they generate an exception on quiet NaN
operands; but the comparison will be interrupted only if you trap
the invalid operation exception.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


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