Boost logo

Boost :

From: Gabriel Dos Reis (gdr_at_[hidden])
Date: 2003-07-17 09:34:01


"Paul A. Bristow" <boost_at_[hidden]> writes:

| Thanks but this still leaves me feeling that there is a need for a
| 'Standard and Portable' way of indicating 'missing value',

sorry if I sounded negative, that wasn't the intent. I would to make
sure we all undertsand and agree on what is going on.

By "standard and Portable", we need to specifiy exactly what that means.
On some plateform, the notion of special values like NaN just does not
make sens -- either a floating point always object represents a value.
So on those plateforms, we won't have the notion of "missing value".
Clearly such plateform don't have things like NaNs.

| but perhaps this will remain one of the many unmet needs. Choosing a
| bit pattern(s) for 'missing value'etc doesn't seem easily portable
| from your other posts on detecting NaNs in general.

this is an area where practice varies from one community to another;
unfortuenatly. But, from time to time, some architwectures manuals
seem to recommand some practices.

| Does we have to
| have processor specific macros to implement an bool
| is_missing(double)?

Yes, I think that we would need some target-specific macros to
implement notions that missing values (I would prefer singular
values).

| Can one be sure that the bit pattern chosen for
| the 'missing value' NaN won't be produced from a computational
| mishap?

That is why I would suggest conducting some analysis to see how much
practice varies.

| Is there a reason why it should it be a quiet or signalling NaN?

If we were to stay in the real of C99, I would say it should be a qNaN
-- because C99 does not support yet sNaNs. On the other hand the only
traditional use of sNaN was for unitialized objets.

| Leaves me a bit :-(

Floating point arithmetic really is a minefield :-(

-- Gaby


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk