- or download this
sub quant{
# 14 characters, but I am bad at this, I'm sure it can get shorter
int((shift)*8)
}
- or download this
sub quant{ int((shift)*8) }
for ( 1 .. 9 ) {
print "$_ => ", quant( ($_/9) - 0.0001 ), "\n";
}
- or download this
1 => 0
2 => 1
...
7 => 6
8 => 7
9 => 7 // BOOM!