Gentlemen,
Can you please help me understand why this calculation is coming out to be wrong?
I was expecting int (42435.3408/411.9936) as 103. Perl prints the result is 103 but when used int function on the result it is getting 102!!
Here is the code to reproduce the issue...
$i = (42435.3408/411.9936);
$j = $i;
$k = int $j;
$l = int(103);
print "$i, $j, $k, $l\n";
It prints 103, 103, 102, 103
Should the value of $l be 103?
If I use pragma integer (use integer;) at the top then all varaibles are showing 103.
I wanted it to be 103 without having to explicitly 'rounding'.
Thanks for the help.
-Anju