
I wish to optimize Haskell code using ByteString, direct reading Doubles form it, direct writing Doubles to it. I've tried Don Stewart's code http://hpaste.org/26 that uses calling to C functions to implement necessary readDouble & showDouble. readDouble works ok. showDouble always return "nan" in Mac OS X (but works well in Windows). I'm using GHC 6.6 in Mac (http://www.haskell.org/ghc/download_ghc_66.html#macosxppc) and in Windows (http://www.haskell.org/ghc/download_ghc_66.html#windows). I've made showInt based on showDouble: http://hpaste.org/1390 It works well in Mac OS X. It seems that problem happens only when I send CDouble (or CLDouble) to C function. My conf: PowerBook G4, Mac OS X 10.4.9, powerpc-apple-darwin8-gcc-4.0.1 What may cause this? How to fix it?