
30 Mar
2010
30 Mar
'10
8:47 p.m.
"DE" wrote:
on 30.03.2010 at 19:45 Peter Dimov wrote :
Right. What is the purpose of the NaN? Its function is to delay the exception until the first use of the result, making the point of the erroneous calculation harder to trace. In what scenario is this a good thing? if you don't want to deal with specific exceptions
xint::integer foo(); //... xint::integer i = foo(); MY_ASSERT(i!=NaN);
So, in other words, if you don't want to deal with exceptions, you abort the program on the assert (in debug mode) or throw at the next use of i (in release mode). This doesn't strike me as very useful.