The scientific package

[Tags: bsd3, library]

Data.Scientific provides the number type Scientific. Scientific numbers are arbitrary precision and space efficient. They are represented using scientific notation. The implementation uses a coefficient c :: Integer and a base-10 exponent e :: Int. A scientific number corresponds to the Fractional number: fromInteger c * 10 ^^ e.

Note that since we're using an Int to represent the exponent these numbers aren't truly arbitrary precision. I intend to change the type of the exponent to Integer in a future release.

The main application of Scientific is to be used as the target of parsing arbitrary precision numbers coming from an untrusted source. The advantages over using Rational for this are that:

 > read "1e1000000000" :: Scientific
 1.0e1000000000

Properties

Versions0.0.0.0, 0.0.0.1, 0.0.0.2, 0.1.0.0, 0.1.0.1, 0.2.0.0, 0.2.0.1, 0.2.0.2, 0.3.0.0, 0.3.0.1, 0.3.0.2, 0.3.1.0, 0.3.2.0, 0.3.2.1, 0.3.2.2, 0.3.3.0, 0.3.3.1, 0.3.3.2, 0.3.3.3, 0.3.3.4, 0.3.3.5, 0.3.3.6, 0.3.3.7, 0.3.3.8, 0.3.4.0, 0.3.4.1, 0.3.4.2, 0.3.4.3, 0.3.4.4, 0.3.4.5, 0.3.4.6
Change logchangelog
Dependenciesbase (>=4.3 && <4.10), binary (>=0.4.1 && <0.9), bytestring (==0.10.*), containers (>=0.1 && <0.6), deepseq (>=1.3 && <1.5), ghc-prim, hashable (>=1.1.2 && <1.3), integer-gmp, integer-simple, text (>=0.8 && <1.3), vector (>=0.5 && <0.12) [details]
LicenseBSD3
AuthorBas van Dijk
MaintainerBas van Dijk <v.dijk.bas@gmail.com>
CategoryData
Home pagehttps://github.com/basvandijk/scientific
Bug trackerhttps://github.com/basvandijk/scientific/issues
Source repositoryhead: git clone git://github.com/basvandijk/scientific.git
UploadedThu Mar 10 12:10:09 UTC 2016 by BasVanDijk
DistributionsArch:0.3.4.6, Debian:0.3.4.4, Fedora:0.3.3.1, FreeBSD:0.3.3.8, LTSHaskell:0.3.4.6, NixOS:0.3.4.6, Stackage:0.3.4.6
Downloads198528 total (61 in last 30 days)
Votes
0 []
StatusDocs available [build log]
Last success reported on 2016-03-10 [all 1 reports]

Modules

[Index]

Flags

NameDescriptionDefaultType
bytestring-builderProvide the Data.ByteString.Builder.Scientific module (requires bytestring >= 0.10)EnabledManual
integer-simpleUse the integer-simple package instead of integer-gmpDisabledAutomatic

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainers' corner

For package maintainers and hackage trustees