Andy Bennett scripsit:

> I'm mostly using log2 to work out if numbers are a power of two and find
> the highest bit that they have set.

You can use integer-length to tell how many bits are required.  If you
subtract 1 and the number of bits shrinks by 1, you have a power of 2.

Rules for WWI pilots:

1.  Stay out of WWII.


        --Peanuts

-- 
John Cowan          http://www.ccil.org/~cowan        co...@ccil.org
Overhead, without any fuss, the stars were going out.
        --Arthur C. Clarke, "The Nine Billion Names of God"

_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to