Module

Data.Long.FFI

#Long

data Long :: Type

Instances

#IsUnsigned

#IsLittleEndian

#zero

zero :: Long

Signed zero

#one

one :: Long

Signed one

#negOne

negOne :: Long

Signed negative one

#uzero

uzero :: Long

Unsigned zero

#uone

uone :: Long

Unsigned one

#maxValue

maxValue :: Long

Maximum signed value

#minValue

minValue :: Long

Minimum signed value

#maxUnsignedValue

maxUnsignedValue :: Long

Maximum unsigned value

#isLong

isLong :: Fn1 Foreign Boolean

Tests if the specified object is a Long

#fromBits

fromBits :: Fn3 Int Int IsUnsigned Long

Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is assumed to use 32 bits.

#fromBytes

fromBytes :: Fn3 (Array Int) IsUnsigned IsLittleEndian Long

Creates a Long from its byte representation.

#fromBytesLE

fromBytesLE :: Fn2 (Array Int) IsUnsigned Long

Creates a Long from its little endian byte representation.

#fromBytesBE

fromBytesBE :: Fn2 (Array Int) IsUnsigned Long

Creates a Long from its big endian byte representation.

#fromInt

fromInt :: Fn2 Int IsUnsigned Long

Returns a Long representing the given 32 bit integer value.

#fromNumber

fromNumber :: Fn2 Number IsUnsigned Long

Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.

#fromString

fromString :: EffectFn3 String IsUnsigned Radix Long

Returns a Long representation of the given string, written using the specified radix.

#fromValue

fromValue :: Fn2 Foreign IsUnsigned Long

Converts the specified value to a Long using the appropriate from* function for its type.

#unsigned

#add

add :: Long -> Fn1 Long Long

Returns the sum of this and the specified Long.

#and

and :: Long -> Fn1 Long Long

Returns the bitwise AND of this Long and the specified.

#compare

compare :: Long -> Fn1 Long Int

Compares this Long's value with the specified's. Returns 0 if they are the same, 1 if the this is greater and -1 if the given one is greater.

#divide

divide :: Long -> Fn1 Long Long

Returns this Long divided by the specified.

#equals

equals :: Long -> Fn1 Long Boolean

Tests if this Long's value equals the specified's. Note: The original API accepts any number like input. If provided with another Long, this does not compare signedness.

#getHighBits

getHighBits :: Long -> Number

Gets the high 32 bits as a signed integer. Note: Use Internal.getNumberBitsToInt to get back Int

#getHighBitsUnsigned

getHighBitsUnsigned :: Long -> Number

Gets the high 32 bits as an unsigned integer. Note: Use Internal.getNumberBitsToInt to get back Int

#getLowBits

getLowBits :: Long -> Number

Gets the low 32 bits as a signed integer. Use Internal.getNumberBitsToInt to get back Int

#getLowBitsUnsigned

getLowBitsUnsigned :: Long -> Number

Gets the low 32 bits as an unsigned integer. Use Internal.getNumberBitsToInt to get back Int

#getNumBitsAbs

getNumBitsAbs :: Long -> Int

Gets the number of bits needed to represent the absolute value of this Long.

#greaterThan

greaterThan :: Long -> Fn1 Long Boolean

Tests if this Long's value is greater than the specified's.

#greaterThanOrEqual

greaterThanOrEqual :: Long -> Fn1 Long Boolean

Tests if this Long's value is greater than or equal the specified's.

#isEven

isEven :: Long -> Boolean

Tests if this Long's value is even.

#isNegative

isNegative :: Long -> Boolean

Tests if this Long's value is negative.

#isOdd

isOdd :: Long -> Boolean

Tests if this Long's value is odd.

#isPositive

isPositive :: Long -> Boolean

Tests if this Long's value is positive.

#isZero

isZero :: Long -> Boolean

Tests if this Long's value equals zero.

#lessThan

lessThan :: Long -> Fn1 Long Boolean

Tests if this Long's value is less than the specified's.

#lessThanOrEqual

lessThanOrEqual :: Long -> Fn1 Long Boolean

Tests if this Long's value is less than or equal the specified's.

#modulo

modulo :: Long -> Fn1 Long Long

Returns this Long modulo the specified.

#multiply

multiply :: Long -> Fn1 Long Long

Returns the product of this and the specified Long.

#negate

negate :: Long -> Long

Negates this Long's value.

#not

not :: Long -> Long

Returns the bitwise NOT of this Long.

#notEquals

notEquals :: Long -> Fn1 Long Boolean

Tests if this Long's value differs from the specified's.

#or

or :: Long -> Fn1 Long Long

Returns the bitwise OR of this Long and the specified.

#shiftLeft

shiftLeft :: Long -> Fn1 Long Long

Returns this Long with bits shifted to the left by the given amount.

#shiftRight

shiftRight :: Long -> Fn1 Long Long

Returns this Long with bits arithmetically shifted to the right by the given amount.

#shiftRightUnsigned

shiftRightUnsigned :: Long -> Fn1 Long Long

Returns this Long with bits logically shifted to the right by the given amount.

#rotateLeft

rotateLeft :: Long -> Fn1 Long Long

Returns this Long with bits rotated to the left by the given amount.

#rotateRight

rotateRight :: Long -> Fn1 Long Long

Returns this Long with bits rotated to the right by the given amount.

#subtract

subtract :: Long -> Fn1 Long Long

Returns the difference of this and the specified Long.

#toBytes

toBytes :: Long -> IsLittleEndian -> Array Int

Converts this Long to its byte representation.

#toInt

toInt :: Long -> Int

Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.

#toNumber

toNumber :: Long -> Number

Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).

#toSigned

toSigned :: Long -> Long

Converts this Long to signed.

#toString

toString :: Long -> Fn1 Radix String

Converts the Long to a string written in the specified radix.

#toUnsigned

toUnsigned :: Long -> Long

Converts this Long to unsigned.

#xor

xor :: Long -> Fn1 Long Long

Returns the bitwise XOR of this Long and the given one.

Modules