| Copyright | (C) 2014 Herbert Valerio Riedel (C) 2011 Edward Kmett |
|---|---|
| License | see libraries/base/LICENSE |
| Maintainer | libraries@haskell.org |
| Stability | internal |
| Portability | non-portable (GHC Extensions) |
| Safe Haskell | None |
| Language | Haskell2010 |
GHC.Natural
Description
The arbitrary-precisionNatural number type.
Note: This is an internal GHC module with an API subject to change. It's recommended use theNumeric.Natural module to import theNatural type.
Since: 4.8.0.0
Natural number typeWarning: The internal implementation ofNatural (i.e. which constructors are available) depends on theInteger backend used!
Type representing arbitrary-precision non-negative integers.
>>>2^100 :: Natural1267650600228229401496703205376
Operations whose result would be negative,throw (Underflow ::ArithException)
>>>-1 :: Natural*** Exception: arithmetic underflow
Since: 4.8.0.0
Constructors
| NatS#GmpLimb# | in |
| NatJ# !BigNat | in Invariant: |
naturalToInteger ::Natural ->IntegerSource#
@since 4.X.0.0
naturalFromInteger ::Integer ->NaturalSource#
Since: 4.10.0.0
wordToNatural# ::Word# ->NaturalSource#
Convert a Word# into a Natural
Built-in rule ensures that applications of this function to literal Word# are lifted into Natural literals.
wordToNaturalBase ::Word# ->NaturalSource#
Convert a Word# into a Natural
In base we can't use wordToNatural# as built-in rules transform some of them into Natural literals. Use this function instead.
powModNatural ::Natural ->Natural ->Natural ->NaturalSource#
"" computes basepowModNaturalbemb raised to exponente modulom.
Since: 4.8.0.0
Produced byHaddock version 2.20.0