- or download this
0 <= SIZE < 1
1 <= SIZE < 2
2 <= SIZE < 4
4 <= SIZE < 8
and so on...
- or download this
$size_class = $size ? int( log($size) / log(2) ) : -1;
# red light on, possible error caused by floating point arithmetic
- or download this
bash $ diff <( perl -E 'say int( log(2**$_) / log(2) ) for 1 .. 2**10'
+ ) <( seq 1 $(( 2**10 )) )
- or download this
1024c1024
< inf
---
> 1024