Perl: the Markov chain saw | |
PerlMonks |
Re: Re: Filthy Floatsby Hofmator (Curate) |
on Jul 16, 2001 at 20:53 UTC ( [id://97084]=note: print w/replies, xml ) | Need Help?? |
Watchout, (s)printf does the rounding itself, it doesn't truncate! but sadly this rounding is buggy on numbers ending in .5: A quick and ugly 'fix' is something like printf "%.5f => %.2f\n", 1.025+1e-10, 1.025+1e-10; For better solutions and some discussion see this recent thread. -- Hofmator
In Section
Seekers of Perl Wisdom
|
|