On Tue, Aug 18, 2009 at 9:12 PM, Ryan McConnehey
I have code that converts, using lexical_cast, some numeric values to strings. When upgrading from boost 1.34.1 to 1.39 some of my float and double test values changed. For example the numeric value 1111.11 converts to the string value "1111.11" in boost 1.34.1. In boost 1.39 the numeric value 1111.11 converts to the string value "1111.1099999999999". I find it odd that some values give this long string representation but other values convert exactly (1222.22 for example). Can someone tell me what changed from 1.34.1 to 1.39. I'm pretty sure it has to be the underling code in boost since I used Microsoft Visual Studio 2005 IDE for building my project with both boost versions.
The code I'm using is as follows:
template <typename T> std::string convertValueToText(T const& value) const { return boost::lexical_caststd::string( value ); }
I think it is just representing it in full accuracy now where it did not used to. I think there is something to control that though... Do not really recall, I use Boost.Spirit.Karma/QI now instead of lexical_cast, a lot faster.