random-fu-0.0.2.1: Random number generationSource codeContentsIndex
Data.Random.Internal.Words
Description
A few little functions I found myself writing inline over and over again.
Synopsis
buildWord :: Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> Word64
wordToFloat :: Word64 -> Float
wordToFloatWithExcess :: Word64 -> (Float, Word64)
wordToDouble :: Word64 -> Double
wordToDoubleWithExcess :: Word64 -> (Double, Word64)
Documentation
buildWord :: Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> Word64Source
wordToFloat :: Word64 -> FloatSource
Pack 23 unspecified bits from a Word64 into a Float in the range [0,1). Used to convert a stdUniform Word64 to a stdUniform Double.
wordToFloatWithExcess :: Word64 -> (Float, Word64)Source
Same as wordToFloat, but also return the unused bits (as the 41 least significant bits of a Word64)
wordToDouble :: Word64 -> DoubleSource
Pack 52 unspecified bits from a Word64 into a Double in the range [0,1). Used to convert a stdUniform Word64 to a stdUniform Double.
wordToDoubleWithExcess :: Word64 -> (Double, Word64)Source
Same as wordToDouble, but also return the unused bits (as the 12 least significant bits of a Word64)
Produced by Haddock version 2.4.2