<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><br>I've been trying to play around with binary data, but I haven't made much progress<br>trying to print the bits of a Double. With help from #haskell I've made it this far:<br><br>-- Printing the bits of an Int<br>main = do putStrLn $ showIntAtBase 2 (chr . (48+)) z ""<br><br>-- 103 = 1100111, after bit shifting 11001<br>z = shiftR (103 :: Int64) 2 <br><br>This is as far as I got with Doubles:<br><br>import Data.Binary.IEEE754<br>import qualified Data.ByteString.Lazy as BS<br>main = do BS.putStrLn $ runPut $ putFloat64be 4.123<br><br>Instead of playing with ByteStrings, is there just a way to fill an Int64 with the bits of a Double (Similar to Java's long = Double.doubleToLongBits(double))?<br></td></tr></table><br>