for (my $i = 1; $i < \xFFFF; $i <<= 1) { print round($i+0.555,2), " "; } # which prints: #1.56 2.56 4.55 8.55 16.56 32.56 64.56 128.56 256.56 512.55 #1024.56 2048.55 4096.56 8192.56 16384.56 32768.56 65536.55 #131072.55 262144.55 524288.56 1048576.55 2097152.56 4194304.55 #8388608.55 16777216.56 # #(You can try with different numbers and different precision as long # as the last digit is '5' and the precision = number of digits - 1)