note
BillKSmith
It probably is not possible to predict the results in every case. Consider these two runs of your function. Only the second replicates your original problem.
<c>
use strict;
use warnings;
no warnings 'experimental::signatures';
use feature 'signatures';
sub amnt($amn)
{
my $amount=$_[0];
print "$amount i m checking amount before padding,\n";
my $padamnt = sprintf("%016d",$amount);
print "$padamnt i m checking amount after padding,\n";
return $padamnt;
}
print "EXACT integer\n";
amnt(488715);
print "\n\nNot quite an integer\n";
amnt(488715 - 4e-10);
</c>
<p>OUTPUT:</p>
<c>
EXACT integer
488715 i m checking amount before padding,
0000000000488715 i m checking amount after padding,
Not quite an integer
488715 i m checking amount before padding,
0000000000488714 i m checking amount after padding,
</c>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-957973">
Bill
</div></div>
11136982
11136986