M
Marc Schellens
Is there a standard way of determining the number of digits
a float needs (base 10) to be printed (the integer part)?
log10 is too expensive.
As is a loop dividing by 10.
I could think of something dividing by 10^numeric_limits::max_exponent10/2,
then dividing by
10^numeric_limits::max_exponent10/4,
....
but I don't want to reinvent the wheel as this seems to be
a very basic/often needed function.
thanks,
marc
a float needs (base 10) to be printed (the integer part)?
log10 is too expensive.
As is a loop dividing by 10.
I could think of something dividing by 10^numeric_limits::max_exponent10/2,
then dividing by
10^numeric_limits::max_exponent10/4,
....
but I don't want to reinvent the wheel as this seems to be
a very basic/often needed function.
thanks,
marc