repa-scalar-4.2.0.3: Scalar data types and conversions.

Safe HaskellNone
LanguageHaskell98

Data.Repa.Scalar.Double

Contents

Description

Loading and storing doubles directly from/to memory buffers.

Synopsis

Loading

loadDouble Source

Arguments

:: Ptr Word8

Buffer holding ASCII representation.

-> Int

Length of buffer.

-> IO (Double, Int)

Result, and number of characters read from buffer.

Load an ASCII Double from a foreign buffer returning the value and number of characters read.

Storing

storeDoubleShortest :: Double -> IO (ForeignPtr Word8, Int) Source

Store an ASCII Double, yielding a freshly allocated buffer and its length.

  • The value is printed as either (sign)digits.digits, or in exponential format, depending on which is shorter.
  • The result is buffer not null terminated.

storeDoubleFixed :: Int -> Double -> IO (ForeignPtr Word8, Int) Source

Like showDoubleShortest, but use a fixed number of digits after the decimal point.