Boost logo

Boost :

Subject: Re: [boost] [lexical_cast] Assumed internal double conversion of float?
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2019-01-30 09:53:15


> -----Original Message-----
> From: Boost [mailto:boost-bounces_at_[hidden]] On Behalf Of Brian Kuhl via Boost
> Sent: 29 January 2019 17:28
> To: boost_at_[hidden]
> Cc: Brian Kuhl; adrian.park_at_[hidden]
> Subject: [boost] [lexical_cast] Assumed internal double conversion of float?
>
> Hi Boost experts,
> We are chasing down some test failures with floats on VxWorks using the
> Dinkum clib and c++lib.
> We are testing with clang on Intel and Arm targets and GCC on PowerPC
> targets.
> An example failure at the bottom of this email.
>
> We have determined that boost::detail::lcast_get_precision<float>() is
> returning 9, well in access of the defined FLT_DIG of 6, or the practical
> float limit of 6.92.

It returns std::numeric_limits<float>::maxdigits_10 = 9

This is maximum number of decimal digits that can contain information. Any more are just noise.

std::numeric_limits<float>::digits_10 = 6

This is the number of decimal digits that are certain to be correct.

The other 3 digits are 'noisy'.

Our ancestors should have just used their fingers, and not their thumbs ;-)

HTH

Paul

---
Paul A. Bristow
Prizet Farmhouse
Kendal UK LA8 8AB
+44 (0) 1539 561830

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