http://www.perlmonks.org?node_id=928635


in reply to Re: incrementation loop fails?
in thread incrementation loop fails?

Howdy!

That only works when the precision is 0.1; that cannot be assumed as it is user input. Using printf to limit the precision of the output is one way, but you have to be careful with your limits, based on the user's specified precision. One digit would not be helpful if the precision were 0.01, to haul out an obvious example.

yours,
Michael