ghc-scientific - Numbers represented using scientific notation

Property Value
Distribution openSUSE Leap 15.1
Repository openSUSE Oss all
Package filename ghc-scientific-
Package name ghc-scientific
Package version
Package release lp151.1.2
Package architecture x86_64
Package type rpm
Category Development/Libraries/Haskell
License BSD-3-Clause
Maintainer -
Download size 76.85 KB
Installed size 350.96 KB
"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:
* A 'Scientific' is more efficient to construct. Rational numbers need to be
constructed using '%' which has to compute the 'gcd' of the 'numerator' and
* 'Scientific' is safe against numbers with huge exponents. For example:
'1e1000000000 :: 'Rational'' will fill up all space and crash your program.
Scientific works as expected:
>>> read "1e1000000000" :: Scientific 1.0e1000000000
* Also, the space usage of converting scientific numbers with huge exponents to
''Integral's' (like: 'Int') or ''RealFloat's' (like: 'Double' or 'Float') will
always be bounded by the target type.


Package Version Architecture Repository
ghc-scientific - - -


Name Value - - - - - - - - - - - - - - - - - -


Name Value
ghc-scientific =
ghc-scientific(x86-64) = -


Type URL
Binary Package ghc-scientific-
Source Package ghc-scientific-

Install Howto

Install ghc-scientific rpm package:

# zypper install ghc-scientific




2018-10-20 - Peter Simons <>
- Use https URL to refer to
2018-07-18 -
- Cosmetic: replace tabs with blanks, strip trailing white space,
and update copyright headers with spec-cleaner.
2018-05-14 -
- Update scientific to version
* Due to a regression introduced in the RealFrac methods
and floatingOrInteger became vulnerable to a space blowup when
applied to scientifics with huge exponents. This has now been
fixed again.
* Fix build on GHC < 8.
* Make the methods of the Hashable, Eq and Ord instances safe to
use when applied to scientific numbers coming from untrusted
sources. Previously these methods first converted their arguments
to Rational before applying the operation. This is unsafe because
converting a Scientific to a Rational could fill up all space and
crash your program when the Scientific has a huge base10Exponent.
Do note that the hash computation of the Hashable Scientific
instance has been changed because of this improvement!
Thanks to Tom Sydney Kerckhove (@NorfairKing) for pushing me to
fix this.
* fromRational :: Rational -> Scientific now throws an error
instead of diverging when applied to a repeating decimal. This
does mean it will consume space linear in the number of digits of
the resulting scientific. This makes "fromRational" and the other
Fractional methods "recip" and "/" a bit safer to use.
* To get the old unsafe but more efficient behaviour the following
function was added: unsafeFromRational :: Rational -> Scientific.
* Add alternatives for fromRationalRepetend:
:: Int -- ^ limit
- > Rational
- > Either (Scientific, Rational)
(Scientific, Maybe Int)
:: Rational -> (Scientific, Maybe Int)
Thanks to Ian Jeffries (@seagreen) for the idea.
* Dropped upper version bounds of dependencies
because it's to much work to maintain.
2017-07-11 -
- Update to version
2017-07-03 -
- Update to version revision 2.
2017-06-12 -
- Update to version
2017-05-31 -
- Update to version
2017-04-19 -
- Update to version with cabal2obs.
2017-04-04 -
- Update to version with cabal2obs.
2017-02-12 -
- Update to version with cabal2obs.

See Also

Package Description
ghc-scientific-devel- Haskell scientific library development files
ghc-semigroupoids-5.3.2-lp151.1.3.x86_64.rpm Semigroupoids: Category sans id
ghc-semigroupoids-devel-5.3.2-lp151.1.3.x86_64.rpm Haskell semigroupoids library development files
ghc-semigroups-0.18.5-lp151.1.2.x86_64.rpm Anything that associates
ghc-semigroups-devel-0.18.5-lp151.1.2.x86_64.rpm Haskell semigroups library development files
ghc-setenv- A cross-platform library for setting environment variables
ghc-setenv-devel- Haskell setenv library development files
ghc-setlocale- Haskell bindings to setlocale
ghc-setlocale-devel- Haskell setlocale library development files
ghc-shelly-1.8.1-lp151.1.2.x86_64.rpm Shell-like (systems) programming in Haskell
ghc-shelly-devel-1.8.1-lp151.1.2.x86_64.rpm Haskell shelly library development files
ghc-silently-1.2.5-lp151.3.2.x86_64.rpm Prevent or capture writing to stdout and other handles
ghc-silently-devel-1.2.5-lp151.3.2.x86_64.rpm Haskell silently library development files
ghc-skylighting-0.7.6-lp151.1.2.x86_64.rpm Syntax highlighting library
ghc-skylighting-core-0.7.6-lp151.1.2.x86_64.rpm Syntax highlighting library