# The scientific package

`Data.Scientific` provides a space efficient and arbitrary precision
scientific number type.

`Scientific` numbers are represented using
scientific notation. It
uses a coefficient `c :: Integer` and a base-10 exponent

`e ::`(do note that since we're using an

`Int``Int`to represent the exponent these numbers aren't truly arbitrary precision). A scientific number corresponds to the

`Fractional`number:

`.`

`fromInteger`c * 10`^^`eThe 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:

A

`Scientific`is more efficient to construct. Rational numbers need to be constructed using`%`which has to compute the`gcd`of the`numerator`and`denominator`. Scientific numbers only need to be normalized, i.e.`10000000`to`1e7`.`Scientific`is safe against numbers with huge exponents. For example:`1e1000000000 ::`will fill up all space and crash your program. Scientific works as expected:`Rational`

> read "1e1000000000" :: Scientific 1.0e1000000000

Also, the space usage of converting scientific numbers with huge exponents to

(like:`Integral`s`Int`) or(like:`RealFloat`s`Double`or`Float`) will always be bounded by the target type.

- No changelog available

## Properties

Versions | 0.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 |
---|---|

Dependencies | arithmoi (>=0.4.1 && <0.5), array (>=0.1 && <0.6), base (>=4.3 && <4.8), bytestring (==0.10.*), deepseq (==1.3.*), hashable (>=1.1.2 && <1.3), text (>=0.8 && <1.3) |

License | BSD3 |

Author | Bas van Dijk |

Maintainer | Bas van Dijk <v.dijk.bas@gmail.com> |

Category | Data |

Home page | https://github.com/basvandijk/scientific |

Bug tracker | https://github.com/basvandijk/scientific/issues |

Source repository | head: git clone git://github.com/basvandijk/scientific.git |

Uploaded | Wed May 14 05:38:00 UTC 2014 by BasVanDijk |

Distributions | Debian:0.3.3.2, Fedora:0.3.2.1, FreeBSD:0.3.3.0, LTSHaskell:0.3.3.7, NixOS:0.3.3.7, Stackage:0.3.3.7 |

Downloads | 187475 total (1225 in last 30 days) |

Status | Docs available [build log] Successful builds reported [all 1 reports] |

## Modules

*Data**ByteString*- Data.Scientific
*Text**Lazy*

[Index]

## Downloads

- scientific-0.3.0.1.tar.gz [browse] (Cabal source package)
- Package description (included in the package)

#### Maintainers' corner

For package maintainers and hackage trustees