int_pow2: Exponentiation function for integer arguments

Description Arguments

Description

Solaris' compiler freaked hard on the pow function—couldn't figure out whether it should return an int or a float or something, when I used it to get very small powers of two. So I am going to write a silly, simple function (that only gets used a couple of times in an entire execution, and only with very small arguments, so the fact that it is not super efficient should not be a big problem).

Arguments

x

the integer to raise 2 to.


CKMRpop documentation built on July 17, 2021, 5:07 p.m.