[AusNOG] Looking for employees? Melbourne based
Ross Wheeler
ausnog at rossw.net
Fri Oct 11 15:55:04 EST 2013
> I even went to confirm it to see if Perl didn't have that problem:
> perl
> print 0.2+0.1;
> 0.3
>
> Working as intended :)
The problem of floating point approximating numbers that are not
exact powers of 2 remains the problem, regardless of how your chosen
language handles it.
$ echo "scale=50; 1/10+2/10"|bc
.30000000000000000000000000000000000000000000000000
$ awk 'BEGIN{printf("%.40f\n",1/10+2/10)}'
0.3000000000000000444089209850062616169453
More information about the AusNOG
mailing list