Boost logo

Boost :

From: Paul A Bristow (pbristow_at_[hidden])
Date: 2008-03-03 11:49:24


 

>-----Original Message-----
>From: boost-bounces_at_[hidden]
>[mailto:boost-bounces_at_[hidden]] On Behalf Of Guillaume Melquiond
>Sent: 25 February 2008 21:49
>To: boost_at_[hidden]
>Subject: Re: [boost] Floating Point Utilities Review starts today
>
>As I explained in a previous mail, the sign bit is not part of the NaN
>payload. So a standard-compliant compiler is allowed to
>replace -NaN(17) by NaN(17) in the code.

OK - you obviously know vastly more than I about this - if the Standard says this, (unhelpful or not) then it would be a bad idea to
try to use the sign bit to carry any information.

But this still me leaves wondering about the original (very common) use case - you have a 'database' (and you want to be able to
serialize - and back (of course, at least for systems using the same FP layout for floats and doubles). Without loopback it's
difficult to validate its contents.

It would be extremely useful to be able to distiguish between values that never existed - 'missing values' and those that some
computation results in a NaN.

Can you suggest how to achieve a 'missing value'?

Surely we can do better than 'Enter 999999.9 to end input' - using a single FP bit pattern for 'missing value'?

Do we have to accept storing a bool with each value - and take a serious hit in 'database' size and the cost of its transfer?

Do we use other bit(s) in the NaN payload?

Paul

---
Paul A Bristow
Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB
+44 1539561830 & SMS, Mobile +44 7714 330204 & SMS
pbristow_at_[hidden]
 
  

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