mirror of
https://github.com/boostorg/spirit.git
synced 2026-01-19 04:42:11 +00:00
Karma: Do not hardcap precision of real_inserter (#586)
Users should be able to decide how much mantissa digits they want to print. Co-authored-by: Nikita Kniazev <nok.raven@gmail.com>
This commit is contained in:
committed by
GitHub
parent
9643bbdf4c
commit
50a3e6a725
@@ -83,12 +83,6 @@ namespace boost { namespace spirit { namespace karma
|
||||
|
||||
// get correct precision for generated number
|
||||
unsigned precision = p.precision(n);
|
||||
if (std::numeric_limits<U>::digits10)
|
||||
{
|
||||
// limit generated precision to digits10, if defined
|
||||
precision = (std::min)(precision,
|
||||
(unsigned)std::numeric_limits<U>::digits10 + 1);
|
||||
}
|
||||
|
||||
// allow for ADL to find the correct overloads for log10 et.al.
|
||||
using namespace std;
|
||||
|
||||
@@ -161,8 +161,7 @@ namespace boost { namespace spirit { namespace karma
|
||||
//
|
||||
// Note: If the trailing_zeros flag is not in effect additional
|
||||
// comments apply. See the comment for the fraction_part()
|
||||
// function below. Moreover, this precision will be limited
|
||||
// to the value of std::numeric_limits<T>::digits10 + 1
|
||||
// function below.
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
static unsigned precision(T)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user