Moduleghc-bignum-1.3Haskell2010
GHC.Num.Primitives
- 1 type
- 57 values
- Packageghc-bignum-1.3
- Exports58
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourcePrimitives.hs
Bool#
4 declarationsInt#
8 declarationsBranchless signum
Branchless abs
Branchless comparison
Encode (# Int# mantissa, Int# exponent #) into a Double#.
(provided by GHC's RTS)
Population count
Word#
19 declarationsSafe right shift for Word#
Add 3 values together
(h,l) <- a + (hb,lb)
2-by-1 large division
Requires: b0 /= 0 a1 >= b0 (not required, but if not q1=0)
Return the absolute value of the Int# in a Word#
Compute base-2 log of Word#
This is internally implemented as count-leading-zeros machine instruction.
Logarithm for an arbitrary base
Indicate if the value is a power of two and which one
Encode (# Word# mantissa, Int# exponent #) into a Double#.
(provided by GHC's RTS)
Reverse bits in a Word#
Reverse bits in the Word32 subwords composing a Word#
Reverse bytes in a Word#
Addr import/export
Read a Word from addr in base-256 representation.
@n is the number of bytes to read.
The endianness is selected with the Bool# parameter: write most significant
byte first (big-endian) if 1# or least significant byte first
(little-endian) if 0#.
Read a Word from addr in base-256 little-endian representation.
@n is the number of bytes to read.
Read a Word from addr in base-256 big-endian representation.
@n is the number of bytes to read.
Write a Word to addr in base-256 representation and
return the number of bytes written.
The endianness is selected with the Bool# parameter: write most significant
byte first (big-endian) if 1# or least significant byte first
(little-endian) if 0#.
Write a Word to addr in base-256 little-endian representation and
return the number of bytes written.
Write a Word to addr in base-256 big-endian representation and
return the number of bytes written.
Write a full word with little-endian encoding
Write a full word with little-endian encoding
ByteArray import/export
Read a Word from ByteArray in base-256 representation.
@n is the number of bytes to read.
The endianness is selected with the Bool# parameter: write most significant
byte first (big-endian) if 1# or least significant byte first
(little-endian) if 0#.
Read a Word from ByteArray in base-256 little-endian representation.
@n is the number of bytes to read.
Read a Word from ByteArray in base-256 big-endian representation.
@n is the number of bytes to read.
Write a Word to MutableByteArray in base-256 representation and
return the number of bytes written.
The endianness is selected with the Bool# parameter: write most significant
byte first (big-endian) if 1# or least significant byte first
(little-endian) if 0#.
The offset is in bytes.
Write a Word to MutableByteArray in base-256 little-endian
representation and return the number of bytes written.
The offset is in bytes.
Write a Word to MutableByteArray in base-256 big-endian representation and
return the number of bytes written.
The offset is in bytes.
Write a full word with little-endian encoding
Write a full word with little-endian encoding
Exception
7 declarationsRaise GHC.Exception.Type.underflowException
Raise GHC.Exception.Type.divZeroException