Boost logo

Boost Users :

From: Adam M (boost_at_[hidden])
Date: 2005-11-12 17:41:29


Hi Robert,

It turns out I was losing my precision before I even got into
Boost.Serialization. Thanks for the tip.

-Adam

On Sat, 12 Nov 2005 12:42:48 -0800, "Robert Ramey" <ramey_at_[hidden]>
said:
> 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 mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


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