integer-gmp-0.5.1.0: Integer library based on GMP

Copyright(c) The University of Glasgow 1994-2008
Licensesee libraries/integer-gmp/LICENSE
Maintainercvs-ghc@haskell.org
Stabilityinternal
Portabilitynon-portable (GHC Extensions)
Safe HaskellNone
LanguageHaskell2010

GHC.Integer

Contents

Description

The Integer type.

This module exposes the portable Integer API. See GHC.Integer.GMP.Internals for the GMP-specific internal representation of Integer as well as optimized GMP-specific operations.

Synopsis

Documentation

data Integer Source

Arbitrary-precision integers.

Instances

Eq Integer 
Ord Integer 

Construct Integers

mkInteger Source

Arguments

:: Bool

sign of integer (True if non-negative)

-> [Int]

absolute value expressed in 31 bit chunks, least significant first

-> Integer 

Construct Integer value from list of Ints.

This function is used by GHC for constructing Integer literals.

Conversion to other integral types

Helpers for RealFloat type-class operations

Arithmetic operations

Comparison predicates

eqInteger# :: Integer -> Integer -> Int# Source

Since: 0.5.1.0

neqInteger# :: Integer -> Integer -> Int# Source

Since: 0.5.1.0

leInteger# :: Integer -> Integer -> Int# Source

Since: 0.5.1.0

gtInteger# :: Integer -> Integer -> Int# Source

Since: 0.5.1.0

ltInteger# :: Integer -> Integer -> Int# Source

Since: 0.5.1.0

geInteger# :: Integer -> Integer -> Int# Source

Since: 0.5.1.0

Bit-operations

testBitInteger :: Integer -> Int# -> Bool Source

Since: 0.5.1.0

Hashing

hashInteger :: Integer -> Int# Source

hashInteger returns the same value as fromIntegral, although in unboxed form. It might be a reasonable hash function for Integer, given a suitable distribution of Integer values.

Note: hashInteger is currently just an alias for integerToInt.