Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2005-11-12 15:42:48


The precision is set in basic_text_oprimitive.hpp line 139.
with the statement:
os << std::setprecision(std::numeric_limits<double>::digits10 + 2);

I believe that std::numeric_limits<double>::digits10 returns the number
of digits required to hold the maximum value in base 10. So either

a) I misunderstand the function and/or application of std::numeric_limits
b) its incorrectly implemented on your platform
c) you think you have more precision than you actually do.

look into this and check back

Robert Ramey

Adam M wrote:
> Hi,
>
> I am using Boost.Serialization to serialize a std::map<std::string,
> double>.
>
> It works fine, except that the precision on the double is not enough
> for my application.
>
> Is it possible to manipulate the precision used when
> serializing/deserializing double's within an STL container? I tried
> using setprecision(), but it doesn't understand the "&" stream
> operator that the Serialization library uses.
>
> Thanks,
> Adam


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net