in reply to Re: what did I just see..?
in thread what did I just see..?

> No one seems to have actually told you how to fix this.

I did, I said calculate in cents if you want that precision in the end

Even when using one single division to a float in the final output, it'll print correctly.

DB<3> for ($x=80; $x > 10; $x -= 1) { say $x/100; } 0.8 0.79 0.78 0.77 0.76 0.75 0.74 0.73 0.72 0.71 0.7 ... yadda 0.21 0.2 0.19 0.18 0.17 0.16 0.15 0.14 0.13 0.12 0.11 DB<4>

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^3: what did I just see..?
by Anonymous Monk on Mar 22, 2021 at 08:48 UTC
    Thats not a solution, its sticking your head in the sand. You'll end up coming unstuck at certain values. If are really are going to use cents, use it, and do integer division.
      > You'll end up coming unstuck at certain values

      Show me!

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery