On Thu, 2008-12-18 at 22:35 -0500, wren ng thornton wrote:
> In a similar vein, is there already a function available to give the 
> size of Word in bytes? Or should I write the usual Ptr conversion tricks 
> to figure it out?

How about this:

(`div` 8) $ ceiling $ logBase 2 $ fromIntegral (maxBound :: Word)

Could write an integral log_2 function to make it nicer :)

- George

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to