planet-mitchell-0.1.0: Planet Mitchell

Safe Haskell None Haskell2010

Num.Integer

Contents

Synopsis

# Integer

data Integer #

Invariant: Jn# and Jp# are used iff value doesn't fit in S#

Useful properties resulting from the invariants:

• abs (S# _) <= abs (Jp# _)
• abs (S# _) <  abs (Jn# _)
Instances
 Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsenumFrom :: Integer -> [Integer] #enumFromThen :: Integer -> Integer -> [Integer] #enumFromTo :: Integer -> Integer -> [Integer] #enumFromThenTo :: Integer -> Integer -> Integer -> [Integer] # Instance detailsDefined in GHC.Integer.Type Methods(==) :: Integer -> Integer -> Bool #(/=) :: Integer -> Integer -> Bool # Since: base-2.0.1 Instance detailsDefined in GHC.Real MethodsquotRem :: Integer -> Integer -> (Integer, Integer) #divMod :: Integer -> Integer -> (Integer, Integer) # Since: base-4.0.0.0 Instance detailsDefined in Data.Data Methodsgfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Integer -> c Integer #gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Integer #dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Integer) #dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Integer) #gmapT :: (forall b. Data b => b -> b) -> Integer -> Integer #gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Integer -> r #gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Integer -> r #gmapQ :: (forall d. Data d => d -> u) -> Integer -> [u] #gmapQi :: Int -> (forall d. Data d => d -> u) -> Integer -> u #gmapM :: Monad m => (forall d. Data d => d -> m d) -> Integer -> m Integer #gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Integer -> m Integer #gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Integer -> m Integer # Since: base-2.1 Instance detailsDefined in GHC.Num Methods Instance detailsDefined in GHC.Integer.Type Methods(<) :: Integer -> Integer -> Bool #(<=) :: Integer -> Integer -> Bool #(>) :: Integer -> Integer -> Bool #(>=) :: Integer -> Integer -> Bool # Since: base-2.1 Instance detailsDefined in GHC.Read Methods Since: base-2.0.1 Instance detailsDefined in GHC.Real Methods Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowList :: [Integer] -> ShowS # Since: base-2.1 Instance detailsDefined in GHC.Arr Methodsrange :: (Integer, Integer) -> [Integer] #index :: (Integer, Integer) -> Integer -> Int #unsafeIndex :: (Integer, Integer) -> Integer -> IntinRange :: (Integer, Integer) -> Integer -> Bool #rangeSize :: (Integer, Integer) -> Int #unsafeRangeSize :: (Integer, Integer) -> Int Instance detailsDefined in Language.Haskell.TH.Syntax Methodslift :: Integer -> Q Exp # Instance detailsDefined in Data.Hashable.Class Methodshash :: Integer -> Int # Instance detailsDefined in Data.Aeson.Types.ToJSON MethodstoJSONList :: [Integer] -> Value #toEncodingList :: [Integer] -> Encoding # Instance detailsDefined in Data.Aeson.Types.ToJSON Methods This instance includes a bounds check to prevent maliciously large inputs to fill up the memory of the target system. You can newtype Scientific and provide your own instance using withScientific if you want to allow larger inputs. Instance detailsDefined in Data.Aeson.Types.FromJSON Methods Instance detailsDefined in Data.Aeson.Types.FromJSON Methods Since: base-2.1 Instance detailsDefined in Text.Printf Methods Since: base-2.1 Instance detailsDefined in Data.Bits Methodsshift :: Integer -> Int -> Integer #rotate :: Integer -> Int -> Integer #bit :: Int -> Integer #setBit :: Integer -> Int -> Integer #testBit :: Integer -> Int -> Bool #shiftL :: Integer -> Int -> Integer #shiftR :: Integer -> Int -> Integer # Instance detailsDefined in Control.DeepSeq Methodsrnf :: Integer -> () # >>> pretty (2^123 :: Integer) 10633823966279326983230456482242756608  Instance detailsDefined in Data.Text.Prettyprint.Doc.Internal Methodspretty :: Integer -> Doc ann #prettyList :: [Integer] -> Doc ann # Since: serialise-0.2.0.0 Instance detailsDefined in Codec.Serialise.Class MethodsencodeList :: [Integer] -> Encoding # Instance detailsDefined in Data.Generics.Product.Types Methods KnownNat n => Reifies (n :: Nat) Integer Instance detailsDefined in Data.Reflection Methodsreflect :: proxy n -> Integer # () :=> (Enum Integer) Instance detailsDefined in Data.Constraint Methodsins :: () :- Enum Integer # () :=> (Eq Integer) Instance detailsDefined in Data.Constraint Methodsins :: () :- Eq Integer # Instance detailsDefined in Data.Constraint Methods () :=> (Num Integer) Instance detailsDefined in Data.Constraint Methodsins :: () :- Num Integer # () :=> (Ord Integer) Instance detailsDefined in Data.Constraint Methodsins :: () :- Ord Integer # () :=> (Real Integer) Instance detailsDefined in Data.Constraint Methodsins :: () :- Real Integer # () :=> (Bits Integer) Instance detailsDefined in Data.Constraint Methodsins :: () :- Bits Integer #

Calculate the integer logarithm for an arbitrary base. The base must be greater than 1, the second argument, the number whose logarithm is sought, must be positive, otherwise an error is thrown. If base == 2, the specialised version is called, which is more efficient than the general algorithm.

Satisfies:

base ^ integerLogBase base m <= m < base ^ (integerLogBase base m + 1)

for base > 1 and m > 0.

Calculate the integer logarithm of an Integer to base 2. The argument must be positive, otherwise an error is thrown.

Calculate the integer logarithm of an Integer to base 10. The argument must be positive, otherwise an error is thrown.