Think about Loose Coupling | |
PerlMonks |
Re^3: Padding with sprintf changing numberby syphilis (Archbishop) |
on Sep 27, 2021 at 14:26 UTC ( [id://11137041]=note: print w/replies, xml ) | Need Help?? |
I've rewritten your code into a form that I think makes at least some sense:
When I run that script, I get: Note that I've added a line of code that demonstrates that the EXACT value of $amt is NOT 488715. Perl's print() function frequently fails to produce an accurate representation of floating point values - and that's what is happening here. That output I'm seeing is as I expect. Which is the line of output that you don't understand ? You need to stay alert to this aspect of perl's print() function. Neither python3 nor raku are afflicted with such a poorly designed implementation:
Cheers, Rob
In Section
Seekers of Perl Wisdom
|
|