]> git.lyx.org Git - features.git/commit
Fix bugs 9190 and 9193.
authorEnrico Forestieri <forenr@lyx.org>
Sun, 27 Jul 2014 22:33:13 +0000 (00:33 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Sun, 27 Jul 2014 22:33:13 +0000 (00:33 +0200)
commit5f7948e5a52b7c6e375b5fbe676578a8b8117de0
treea80db1f7d6e39d70ab1f73a2338680f54563f853
parentedddfb99fc2ca810a77a286b6a7730881610199c
Fix bugs 9190 and 9193.

The conversion from floating point to string performed by
boost:lexical_cast does not allow specifying a precision and,
for example, values such as 0.9 are returned as 0.899999976.
The standard C++ way for performing the conversion is using
std::ostringstream which is exempt from this problem, even if
less efficient. For the sake of accuracy, boost::lexical_cast
is ditched in favor of the ostrinsgstream implementation.
In C++11 another option would be using std::to_string, but I
think it is not as efficient as the boost way and not worth
implementing through #ifdef's.
src/support/convert.cpp
status.21x