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