Module

Data.UInt64

Package
purescript-int64
Repository
purescript-contrib/purescript-int64

Unsigned 64-bit integers.

#fromLowHighBits Source

fromLowHighBits :: Int -> Int -> UInt64

Creates a UInt64 from low and high bits represented as Int.

#fromInt Source

fromInt :: Int -> Maybe UInt64

Creates a UInt64 from an Int value.

#fromNumber Source

fromNumber :: Number -> Maybe UInt64

Creates a UInt64 from a Number value. The number must already be an integer and fall within the valid range of values for the UInt64 type otherwise Nothing is returned.

#fromString Source

fromString :: String -> Maybe UInt64

Reads a UInt64 from a String value. The number must parse as an integer and fall within the valid range of values for the UInt64 type, otherwise Nothing is returned.

#fromStringAs Source

fromStringAs :: Radix -> String -> Maybe UInt64

Like fromString, but the integer can be specified in a different base.

#lowBits Source

lowBits :: UInt64 -> Int

Get the low (least significant) 32 bits of a UInt64 as an Int.

#highBits Source

highBits :: UInt64 -> Int

Get the high (most significant) 32 bits of a UInt64 as an Int.

#toInt Source

toInt :: UInt64 -> Maybe Int

Creates an Int if the UInt64 value is within the range of UInt64.

#toNumber Source

toNumber :: UInt64 -> Number

Creates a Number value from a UInt64. Values greater than Number.MAX_SAFE_INTEGER will lose precision.

#toString Source

toString :: UInt64 -> String

Like show, but omits the ul suffix.

#toStringAs Source

toStringAs :: Radix -> UInt64 -> String

Like toStringAs, but the integer can be specified in a different base.

#parity Source

parity :: UInt64 -> Parity

Returns whether a UInt64 is Even or Odd.

#even Source

even :: UInt64 -> Boolean

Returns whether a UInt64 is an even number.

#odd Source

odd :: UInt64 -> Boolean

Returns whether a UInt64 is an odd number.

#quot Source

quot :: UInt64 -> UInt64 -> UInt64

For unsigned longs, quot is identical to div.

#rem Source

rem :: UInt64 -> UInt64 -> UInt64

For unsigned longs, quot is identical to mod.

#toSigned Source

toSigned :: UInt64 -> Int64

Converts to an Int64 by reading the bits as a 2’s-complement 64-bit signed integer.

#and Source

and :: UInt64 -> UInt64 -> UInt64

Bitwise AND.

#(.&.) Source

Operator alias for Data.UInt64.and (left-associative / precedence 10)

#or Source

or :: UInt64 -> UInt64 -> UInt64

Bitwise OR.

#(.|.) Source

Operator alias for Data.UInt64.or (left-associative / precedence 10)

#xor Source

xor :: UInt64 -> UInt64 -> UInt64

Bitwise XOR.

#(.^.) Source

Operator alias for Data.UInt64.xor (left-associative / precedence 10)

#shl Source

shl :: UInt64 -> UInt64 -> UInt64

Bitwise shift left.

#shr Source

shr :: UInt64 -> UInt64 -> UInt64

Bitwise shift right.

#zshr Source

zshr :: UInt64 -> UInt64 -> UInt64

Bitwise zero-fill shift right.

#complement Source

complement :: UInt64 -> UInt64

Bitwise NOT.

Re-exports from Data.Int64.Internal

#UInt64 Source

type UInt64 = Long' Unsigned

Unsigned 64-bit integer.