[PATCH] D19623: [libcxx] [test] Initialize local doubles to NaN.
Stephan T. Lavavej via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 29 13:54:06 PDT 2016
STL_MSFT added a comment.
According to my equally vague understanding, a quiet NaN (if used in operations, instead of being overwritten with something valid) will silently propagate down to the assert, which will complain that it's not equal to whatever you were expecting. That would detect any unintentional use of the NaN-initialized value.
A signaling NaN will (I think) raise an FP exception when you try to do anything with it, which may not be treated similarly by your test harness. (I'm not a good person to answer this question, as C1XX has bug/limitations with returning signaling NaNs, to the point where this function in numeric_limits is essentially useless.)
http://reviews.llvm.org/D19623
More information about the cfe-commits
mailing list