RE: [boost] Re: Re: is_nan - how to flag missing values?

2003-07-17 Thread Paul A. Bristow
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:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]



| -Original Message-
| From: [EMAIL PROTECTED]
| [mailto:[EMAIL PROTECTED] 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 [EMAIL PROTECTED] 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
|
|

___
Unsubscribe  other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Re: [boost] Re: Re: is_nan - how to flag missing values?

2003-07-17 Thread Gabriel Dos Reis
Paul A. Bristow [EMAIL PROTECTED] 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
___
Unsubscribe  other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


RE: [boost] Re: Re: is_nan - how to flag missing values?

2003-07-16 Thread Paul A. Bristow


| -Original Message-
| From: [EMAIL PROTECTED]
| [mailto:[EMAIL PROTECTED] Behalf Of Gabriel Dos Reis
| Sent: Sunday, July 13, 2003 9:22 AM
| To: Boost mailing list
| Subject: Re: [boost] Re: Re: is_nan
|
|
| Paul A. Bristow [EMAIL PROTECTED] writes:
| | There is also a single IEEE FP pattern called 'indeterminate' or
| what Intel call
| | 'NotAVal (0x1fffe000...) which might become useful as a Portable Standard
| | missing value marker if portably supported?

| I won't take that road.

Well if not then can you suggest a potentially Portable and Standard way to
indicate 'missing values' in arrays etc of floating point values. I'm not sure
that a qNaN is the best way to do this - it seems better suited to the result of
compuational mishaps.

| 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).

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.

Suggestions?

Paul

Paul A Bristow, Prizet Farmhouse, Kendal, Cumbria, LA8 8AB  UK
+44 1539 561830   Mobile +44 7714 33 02 04
Mobile mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]


___
Unsubscribe  other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Re: [boost] Re: Re: is_nan - how to flag missing values?

2003-07-16 Thread Gabriel Dos Reis
Paul A. Bristow [EMAIL PROTECTED] 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