Safe Haskell | Trustworthy |
---|---|
Language | Haskell2010 |
This module backports ieee754 double/float combinators from binary 0.8.4 to older version, and simply re-export these combinators for binary >= 0.8.4. You can safely import this module alongside Data.Binary.Get and Data.Binary.Put.
Implements casting via a 1-elemnt STUArray, as described in http://stackoverflow.com/a/7002812/263061.
- floatToWord :: Float -> Word32
- wordToFloat :: Word32 -> Float
- doubleToWord :: Double -> Word64
- wordToDouble :: Word64 -> Double
- getFloatbe :: Get Float
- getFloatle :: Get Float
- getFloathost :: Get Float
- getDoublebe :: Get Double
- getDoublele :: Get Double
- getDoublehost :: Get Double
- putFloatbe :: Float -> Put
- putFloatle :: Float -> Put
- putFloathost :: Float -> Put
- putDoublebe :: Double -> Put
- putDoublele :: Double -> Put
- putDoublehost :: Double -> Put
Double/Float Word cast
Double/Floats Get
getFloatbe :: Get Float
getFloatle :: Get Float
getFloathost :: Get Float
getDoublebe :: Get Double
getDoublele :: Get Double
getDoublehost :: Get Double
Double/Floats Put
putFloatbe :: Float -> Put
putFloatle :: Float -> Put
putFloathost :: Float -> Put
putDoublebe :: Double -> Put
putDoublele :: Double -> Put
putDoublehost :: Double -> Put