From: Paul A. Bristow (boost_at_[hidden])
Date: 2003-08-18 16:31:48
Agreed - but what do we do if NOT is_iec559?
Give up? #error "Can only work with IEEE 754!"
Or choose a massive amount of decimal digits? eg 40?
Paul A Bristow, Prizet Farmhouse, Kendal, Cumbria, LA8 8AB UK
+44 1539 561830 Mobile +44 7714 33 02 04
| -----Original Message-----
| From: boost-bounces_at_[hidden]
| [mailto:boost-bounces_at_[hidden]]On Behalf Of Daryle Walker
| Sent: Monday, August 18, 2003 7:05 AM
| To: Boost
| Subject: [boost] Re: Insufficient significant digits using lexical_cast
| On Sunday, August 17, 2003, at 10:33 PM, Paul A. Bristow wrote:
| > But you are right that it would be better to check that
| > numeric_limits::digits exists and isn't something silly before using
| > the formula. With all the built-in floating point types it should be
| > fine, and for other (well) User defined floating point types too. (I
| > will look at this).
| I think you need to check numeric_limits::radix since your algorithm
| had a base-2-to-10 conversion (the type may not actually be binary!).
| The algorithm was based off a paper about IEEE-754; if IEEE-754 is a
| requirement, you may have to check for that too (via
| numeric_limits::is_iec559). Remember that even the built-in
| floating-point types aren't guaranteed to match IEEE-754!
| 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