The scientific package

[ Tags: bsd3, data, library ] [ Propose Tags ]

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


Change log changelog
Dependencies base (>=4.3 && <4.11), binary (>=0.4.1 && <0.9), bytestring (>=0.9 && <0.11), bytestring-builder (>=0.10.4 && <0.11), containers (>=0.1 && <0.6), deepseq (>=1.3 && <1.5), ghc-prim, hashable (>=1.1.2 && <1.3), integer-gmp, integer-logarithms (>=1 && <1.1), integer-simple, text (>=0.8 && <1.3), vector (>=0.7 && <0.13) [details]
License BSD3
Author Bas van Dijk
Maintainer Bas van Dijk <>
Category Data
Home page
Bug tracker
Source repo head: git clone git://
Uploaded Thu Jul 6 22:27:02 UTC 2017 by BasVanDijk
Updated Thu Jul 6 22:32:46 UTC 2017 by BasVanDijk to revision 1   [What is this?]
Distributions Arch:, Debian:, Fedora:, FreeBSD:, LTSHaskell:, NixOS:, Stackage:, openSUSE:
Downloads 330328 total (668 in the last 30 days)
Rating 1.75 (votes: 2) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-07-06 [all 1 reports]
Hackage Matrix CI





Depend on the bytestring-builder package for backwards compatibility.


Use the integer-simple package instead of integer-gmp


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


Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

For package maintainers and hackage trustees