|
Boost : |
From: Paul A. Bristow (boost_at_[hidden])
Date: 2003-07-17 08:22:41
Thanks but this still leaves me feeling that there is a need for a 'Standard and
Portable' way of indicating 'missing value', 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. Does
we have to have processor specific macros to implement an bool
is_missing(double)? Can one be sure that the bit pattern chosen for the 'missing
value' NaN won't be produced from a computational mishap? Is there a reason why
it should it be a quiet or signalling NaN?
Leaves me a bit :-(
Paul
Paul A Bristow, Prizet Farmhouse, Kendal, Cumbria, LA8 8AB UK
+44 1539 561830 Mobile +44 7714 33 02 04
Mobile mailto:pabristow_at_[hidden]
mailto:pbristow_at_[hidden]
| -----Original Message-----
| From: boost-bounces_at_[hidden]
| [mailto:boost-bounces_at_[hidden]]On Behalf Of Gabriel Dos Reis
| Sent: Wednesday, July 16, 2003 10:46 PM
| To: Boost mailing list
| Subject: Re: [boost] Re: Re: is_nan - how to flag missing values?
|
|
| "Paul A. Bristow" <boost_at_[hidden]> writes:
|
| | | Signalling NaNs are used to indicate missing initialization values.
| |
| | This is OK for catching missing initialization by mistake - but not
| | for OK for deliberately missing because there really is no value
| | (measurement missing).
|
| There is not just one qNaN (nor just one sNaN). There is a range for
| NaNs. And most of the systems I worked with, the pattern bits in a
| NaN is used to communicate the reason of being of the NaN. For
| example, it may output sNaN("missing-value").
|
| Note: C99 provides a pseudo-standard way to produce NaNs, through the
| functions
|
| double nan(const char*);
| float nanf(const char*);
| long double nanl(const char*);
|
| |
| | In this case, for example calculating the mean, you want to test if
| the value is
| | present/valid 'is_not_missing' before you add it to the sum and
| increment the
| | count.
| |
| | Testing !is_nan is possible solution but I'm not sure it is ideal.
|
| Indeed, it is no good.
|
| | Suggestions?
|
| I would first make a summary of the usage of the bit patterns for NaNs
| and decide on one and document it.
| _______________________________________________
| Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
|
|
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk