sub log2 { my $n = shift; return log($n)/log(2); } use bigint; puts log2 2**256; # infinity no bigint; puts log2 2**256; # 256