Module

Data.Long.FFI

Package
purescript-longs
Repository
zapph/purescript-longs

#Long Source

data Long :: Type

Instances

#IsUnsigned Source

#zero Source

zero :: Long

Signed zero

#one Source

one :: Long

Signed one

#negOne Source

negOne :: Long

Signed negative one

#uzero Source

uzero :: Long

Unsigned zero

#uone Source

uone :: Long

Unsigned one

#maxValue Source

maxValue :: Long

Maximum signed value

#minValue Source

minValue :: Long

Minimum signed value

#maxUnsignedValue Source

maxUnsignedValue :: Long

Maximum unsigned value

#isLong Source

isLong :: Fn1 Foreign Boolean

Tests if the specified object is a Long

#fromBits Source

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 Source

fromBytes :: Fn3 (Array Int) IsUnsigned IsLittleEndian Long

Creates a Long from its byte representation.

#fromBytesLE Source

fromBytesLE :: Fn2 (Array Int) IsUnsigned Long

Creates a Long from its little endian byte representation.

#fromBytesBE Source

fromBytesBE :: Fn2 (Array Int) IsUnsigned Long

Creates a Long from its big endian byte representation.

#fromInt Source

fromInt :: Fn2 Int IsUnsigned Long

Returns a Long representing the given 32 bit integer value.

#fromNumber Source

fromNumber :: Fn2 Number IsUnsigned Long

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

#fromString Source

fromString :: EffectFn3 String IsUnsigned Radix Long

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

#fromValue Source

fromValue :: Fn2 Foreign IsUnsigned Long

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

#add Source

add :: Long -> Fn1 Long Long

Returns the sum of this and the specified Long.

#and Source

and :: Long -> Fn1 Long Long

Returns the bitwise AND of this Long and the specified.

#compare Source

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 Source

divide :: Long -> Fn1 Long Long

Returns this Long divided by the specified.

#equals Source

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 Source

getHighBits :: Long -> Number

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

#getHighBitsUnsigned Source

getHighBitsUnsigned :: Long -> Number

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

#getLowBits Source

getLowBits :: Long -> Number

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

#getLowBitsUnsigned Source

getLowBitsUnsigned :: Long -> Number

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

#getNumBitsAbs Source

getNumBitsAbs :: Long -> Int

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

#greaterThan Source

greaterThan :: Long -> Fn1 Long Boolean

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

#greaterThanOrEqual Source

greaterThanOrEqual :: Long -> Fn1 Long Boolean

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

#isEven Source

isEven :: Long -> Boolean

Tests if this Long's value is even.

#isNegative Source

isNegative :: Long -> Boolean

Tests if this Long's value is negative.

#isOdd Source

isOdd :: Long -> Boolean

Tests if this Long's value is odd.

#isPositive Source

isPositive :: Long -> Boolean

Tests if this Long's value is positive.

#isZero Source

isZero :: Long -> Boolean

Tests if this Long's value equals zero.

#lessThan Source

lessThan :: Long -> Fn1 Long Boolean

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

#lessThanOrEqual Source

lessThanOrEqual :: Long -> Fn1 Long Boolean

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

#modulo Source

modulo :: Long -> Fn1 Long Long

Returns this Long modulo the specified.

#multiply Source

multiply :: Long -> Fn1 Long Long

Returns the product of this and the specified Long.

#negate Source

negate :: Long -> Long

Negates this Long's value.

#not Source

not :: Long -> Long

Returns the bitwise NOT of this Long.

#notEquals Source

notEquals :: Long -> Fn1 Long Boolean

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

#or Source

or :: Long -> Fn1 Long Long

Returns the bitwise OR of this Long and the specified.

#shiftLeft Source

shiftLeft :: Long -> Fn1 Long Long

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

#shiftRight Source

shiftRight :: Long -> Fn1 Long Long

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

#shiftRightUnsigned Source

shiftRightUnsigned :: Long -> Fn1 Long Long

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

#rotateLeft Source

rotateLeft :: Long -> Fn1 Long Long

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

#rotateRight Source

rotateRight :: Long -> Fn1 Long Long

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

#subtract Source

subtract :: Long -> Fn1 Long Long

Returns the difference of this and the specified Long.

#toBytes Source

toBytes :: Long -> IsLittleEndian -> Array Int

Converts this Long to its byte representation.

#toInt Source

toInt :: Long -> Int

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

#toNumber Source

toNumber :: Long -> Number

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

#toSigned Source

toSigned :: Long -> Long

Converts this Long to signed.

#toString Source

toString :: Long -> Fn1 Radix String

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

#toUnsigned Source

toUnsigned :: Long -> Long

Converts this Long to unsigned.

#xor Source

xor :: Long -> Fn1 Long Long

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