digitalmars.D.learn - Different NaNs used
- bearophile (9/9) Jun 27 2011 This question is related to this thread:
- Lars T. Kyllingstad (6/17) Jun 29 2011 real.init is a signaling NaN, real.nan is not. I don't know if this is
- bearophile (4/6) Jun 29 2011 Thank you for your probably correct hypothesis :-)
This question is related to this thread:
http://d.puremagic.com/issues/show_bug.cgi?id=3632
Can you tell me why real.nan and real.init don't contain the same bit patterns?
import std.math: isIdentical;
void main() {
assert(isIdentical(real.nan, real.init)); // this asserts
}
Bye and thank you,
bearophile
Jun 27 2011
On Mon, 27 Jun 2011 16:41:14 -0400, bearophile wrote:
This question is related to this thread:
http://d.puremagic.com/issues/show_bug.cgi?id=3632
Can you tell me why real.nan and real.init don't contain the same bit
patterns?
import std.math: isIdentical;
void main() {
assert(isIdentical(real.nan, real.init)); // this asserts
}
real.init is a signaling NaN, real.nan is not. I don't know if this is
by design, but I suppose it may be: You can "quiet" a signaling NaN by
assigning real.nan to your variable.
http://en.wikipedia.org/wiki/NaN#Signaling_NaN
-Lars
Jun 29 2011
Lars T. Kyllingstad:real.init is a signaling NaN, real.nan is not. I don't know if this is by design, but I suppose it may be:Thank you for your probably correct hypothesis :-) Bye, bearophile
Jun 29 2011








bearophile <bearophileHUGS lycos.com>