in reply to The last 5 bits in perl
my $last_5_bits = -9133545115225966845 & 31; # 3 [download]
although I'd prefer hex (but that's just me)
my $last_5_bits = -9133545115225966845 & 0x1f; # still 3 [download]