in reply to finding the correct integer
Using int will truncate so if the result, due to the inexact way a computer will represent 0.0001, is, say, 6504.9999997 it will end up as 6504. This seems to work.
johngg@abouriou:~/perl/Monks$ perl -E 'say 0.6505 / 0.0001;' 6505
Cheers,
JohnGG
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: finding the correct integer
by YarNik (Sexton) on Nov 30, 2020 at 15:02 UTC | |
by AnomalousMonk (Archbishop) on Nov 30, 2020 at 20:33 UTC |
In Section
Seekers of Perl Wisdom