[Haskell-cafe] Looking for smallest power of 2 >= Integer

Conal Elliott conal at conal.net
Tue Dec 4 15:41:26 EST 2007

Whatever the answer is, I expect it's relevant to Data.IntSet, which uses
big-endian patricia trees.  - Conal

On Dec 3, 2007 8:36 PM, Dan Piponi <dpiponi at gmail.com > wrote:

> Is there anything in any of the interfaces to Integer that will allow
> me to quickly find the highest bit set in an Integer? If not, does
> anyone have any recommendations for how to do it efficiently. There
> are some obvious things that come to mind but which might involve
> quite a bit of useless copying of data internally by the
> implementation of Integer.
> --
> Dan
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20071204/4de06f47/attachment.htm

More information about the Haskell-Cafe mailing list