not-a-number's

Vincent Lefevre vincent+gcc@vinc17.org
Thu Jan 17 15:46:00 GMT 2013


On 2013-01-17 16:33:56 +0100, Mischa Baars wrote:
> Actually it is the correct way, as long as you stick to the
> conventions. A QNaN is not supposed to change into anything, also
> not with the pow(). Only the other way around. Normal numbers can
> change into QNaN's.

The C standard specified pow(NaN,0) = 1, pow(1,NaN) = 1, and
hypot(inf,NaN) = +inf. You may consider that these are bad choices
(I don't like them much either), but this is how these cases have
been specified. You are free to write wrappers for your own programs
and never call pow and hypot directly...

-- 
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)



More information about the Gcc mailing list