id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 10173,"Epsilon value returned by std::numeric_limits is too small on PowerPC, causing tests to fail",Harris Munir ,Antony Polukhin,"In {{{lexical_cast_float_types_test}}}, {{{std::numeric_limits::epsilon()}}} is used as a tolerance value when comparing long double values to check the accuracy of lexical_cast. On PowerPC, this epsilon value is extremely small for the long double type. While the value is technically correct, since adding 1.0L to it does in fact result in a distinct value, it is not suitable for use as a tolerance value in this type of comparison. Instead, we need a value such that: {{{x + x * eps != x for all x}}} This value can be found by calculating 2^(1-D), where D is the number of bits of precision in the type. We found this same issue in many parts of the Boost math library, and resolved it by adding a special case of {{{boost::math::tools::epsilon}}} for platforms that use the strange ""double-double"" implementation of long double, such as PowerPC. This change is now in the master branch and can be seen here: https://github.com/boostorg/math/blob/7cb3316d0616db01f6c4a56126d4bf8c73e7b50d/include/boost/math/tools/precision.hpp#L160-178 I have created a pull request which replaces all instances of {{{std::numeric_limits::epsilon()}}} with {{{boost::math::tools::epsilon}}} in {{{lexical_cast_float_types_test}}}. This change fixes 5222 of the 5255 failures that currently occur within the test on a PowerPC machine with long double support enabled. The pull request can be found here: https://github.com/boostorg/lexical_cast/pull/3",Bugs,closed,Boost 1.57.0,lexical_cast,Boost Release Branch,Problem,fixed,"lexical_cast_float_types_test, epsilon",