#!/usr/bin/perl
use 5.038;
my $j;
for my $i (2..64){
$j = 1*($i**10); # order of magnitude
say "$i $j -> ", log($j)/log(2); # number of bits
}
exit 2;
__END__
This table shows itertion number, order of magnitude, and log base 2 of that order of magnitude.
Aproximately it shows the conversion ratio for integer numbers to number of bits not rounded.
Math Note: Any neperian or natural logarithm log() is base 'e' where e = exp(1); # 2.7 ...
The conversion from to any base N of the logarithm of a number X is the log(X) / log (N) ratio.
Thus,
sub log10 {
my $x = shift;
return log($x) / log(10);
}
sub log2 {
my $y = shift;
return log($y) / log(2);
}
# vid. perldoc -f log