double-conversion-2.0.2.0: Fast conversion between double precision floating point and text

Copyright(c) 2011 MailRank Inc.
LicenseBSD-style
Maintainerbos@serpentine.com
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell98

Data.Double.Conversion.Text

Description

Fast, efficient support for converting between double precision floating point values and text.

These functions are about 30 times faster than the default show implementation for the Double type.

Synopsis

Documentation

toExponential :: Int -> Double -> Text Source #

Compute a representation in exponential format with the requested number of digits after the decimal point. The last emitted digit is rounded. If -1 digits are requested, then the shortest exponential representation is computed.

toFixed :: Int -> Double -> Text Source #

Compute a decimal representation with a fixed number of digits after the decimal point. The last emitted digit is rounded.

toPrecision :: Int -> Double -> Text Source #

Compute precision leading digits of the given value either in exponential or decimal format. The last computed digit is rounded.

toShortest :: Double -> Text Source #

Compute the shortest string of digits that correctly represent the input number.