binary-ieee754- Backport ieee754 float double combinators to older binary

Safe HaskellTrustworthy




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


Double/Float Word cast

floatToWord :: Float -> Word32 Source

Reinterpret-casts a Float to a Word32.

wordToFloat :: Word32 -> Float Source

Reinterpret-casts a Word32 to a Float.

doubleToWord :: Double -> Word64 Source

Reinterpret-casts a Double to a Word64.

wordToDouble :: Word64 -> Double Source

Reinterpret-casts a Word64 to a Double.

Double/Floats Get

Double/Floats Put

putFloatbe :: Float -> Put

putFloatle :: Float -> Put