Fractional -package:ghc-internal
base Prelude GHC.Real,
hedgehog Hedgehog.Internal.Prelude,
base-compat Prelude.Compat,
protolude Protolude Protolude.Base,
relude Relude.Numeric,
Cabal-syntax Distribution.Compat.Prelude,
universum Universum.Base,
ihaskell IHaskellPrelude,
numhask NumHask.Prelude,
ghc-lib-parser GHC.Prelude.Basic,
dimensional Numeric.Units.Dimensional.Prelude,
rebase Rebase.Prelude,
xmonad-contrib XMonad.Config.Prime,
copilot-language Copilot.Language.Prelude,
incipit-base Incipit.Base,
LambdaHack Game.LambdaHack.Core.Prelude,
cabal-install-solver Distribution.Solver.Compat.Prelude,
faktory Faktory.Prelude,
vcr Imports,
verset Verset,
hledger-web Hledger.Web.Import Fractional numbers, supporting real division.
The Haskell Report defines no laws for
Fractional. However,
(+) and
(*) are customarily expected
to define a division ring and have the following properties:
Note that it
isn't customarily expected that a type instance of
Fractional implement a field. However, all instances in
base do.
Fractional numbers, supporting real division.
The Haskell Report defines no laws for
Fractional. However,
(+) and
(*) are customarily expected
to define a division ring and have the following properties:
- recip gives the multiplicative inverse x
* recip x = recip x * x = fromInteger 1
Note that it
isn't customarily expected that a type instance of
Fractional implement a field. However, all instances in
base do.
Functions for parsing and producing
Fractional values from/to
ByteStrings based on the "Char8" encoding. That is, we assume
an ASCII-compatible encoding of alphanumeric characters.
Since: 0.5.0
Fractional numbers, supporting real division.
Fractional Literal support
e.g. 1.2 :: Double 0.03 :: Float
Fractional numbers, supporting real division.
The Haskell Report defines no laws for
Fractional. However,
'(+)' and '(*)' are customarily expected to define a division ring and
have the following properties:
- recip gives the multiplicative inverse x
* recip x = recip x * x = fromInteger 1
Note that it
isn't customarily expected that a type instance of
Fractional implement a field. However, all instances in
base do.
Safe overrides of the methods of class
Fractional.
parse a fractional number containing a decimal dot
parse a fractional number containing a decimal dot
Fractional Literal
Used (instead of Rational) to represent exactly the floating point
literal that we encountered in the user's source program. This allows
us to pretty-print exactly what the user wrote, which is important
e.g. for floating point numbers that can't represented as Doubles (we
used to via Double for pretty-printing). See also #2245. Note
[FractionalLit representation] in GHC.HsToCore.Match.Literal The
actual value then is: sign * fl_signi * (fl_exp_base^fl_exp) where
sign = if fl_neg then (-1) else 1
For example FL { fl_neg = True, fl_signi = 5.3, fl_exp = 4,
fl_exp_base = Base10 } denotes -5300