Module

Data.Int64.Internal

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

#IsUnsigned Source

#Long Source

data Long

The foreign JavaScript Long object.

Instances

#SignProxy Source

data SignProxy :: Signedness -> Typedata SignProxy (s :: Signedness)

Constructors

#Signedness Source

#add_ Source

add_ :: Long -> Fn1 Long Long

Returns the sum of this and the specified Long.

#and Source

and :: forall s. Long' s -> Long' s -> Long' s

#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.

#complement Source

complement :: forall s. Long' s -> Long' s

#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.

#even Source

even :: forall s. Long' s -> Boolean

#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.

#fromBytesBE_ Source

fromBytesBE_ :: Fn2 (Array Int) IsUnsigned Long

Creates a Long from its big endian byte representation.

#fromBytesLE_ Source

fromBytesLE_ :: Fn2 (Array Int) IsUnsigned Long

Creates a Long from its little endian byte representation.

#fromBytes_ Source

fromBytes_ :: Fn3 (Array Int) IsUnsigned IsLittleEndian Long

Creates a Long from its byte representation.

#fromInt_ Source

fromInt_ :: Fn2 Int IsUnsigned Long

Returns a Long representing the given 32 bit integer value.

#fromLowHighBits Source

fromLowHighBits :: forall s. SInfo s => Int -> Int -> Long' s

#fromNumber Source

fromNumber :: forall s. SInfo s => Bounded (Long' s) => Number -> Maybe (Long' s)

#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 :: forall s. SInfo s => String -> Maybe (Long' s)

#fromStringAs Source

fromStringAs :: forall s. SInfo s => Radix -> String -> Maybe (Long' s)

#fromString_ Source

fromString_ :: EffectFn3 String IsUnsigned Radix Long

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

#getHighBitsUnsigned_ Source

getHighBitsUnsigned_ :: Long -> Number

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

#getHighBits_ Source

getHighBits_ :: Long -> Number

Gets the high 32 bits as a signed integer. Note: 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

#getLowBits_ Source

getLowBits_ :: Long -> Number

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

#greaterThanOrEqual_ Source

greaterThanOrEqual_ :: Long -> Fn1 Long Boolean

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

#greaterThan_ Source

greaterThan_ :: Long -> Fn1 Long Boolean

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

#highBits Source

highBits :: forall s. Long' s -> Int

#isEven_ Source

isEven_ :: Long -> Boolean

Tests if this Long's value is even.

#isLong_ Source

isLong_ :: Fn1 Foreign Boolean

Tests if the specified object is a Long

#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.

#lessThanOrEqual_ Source

lessThanOrEqual_ :: Long -> Fn1 Long Boolean

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

#lessThan_ Source

lessThan_ :: Long -> Fn1 Long Boolean

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

#lowBits Source

lowBits :: forall s. Long' s -> Int

#maxUnsignedValue_ Source

maxUnsignedValue_ :: Long

Maximum unsigned value

#maxValue_ Source

maxValue_ :: Long

Maximum signed value

#minValue_ Source

minValue_ :: Long

Minimum signed value

#modulo_ Source

modulo_ :: Long -> Fn1 Long Long

Returns this Long modulo the specified.

The foreign implementation only works when the divisor is in the Int range.

#multiply_ Source

multiply_ :: Long -> Fn1 Long Long

Returns the product of this and the specified Long.

#negOne_ Source

negOne_ :: Long

Signed negative one TODO Unused?

#negate_ Source

negate_ :: Long -> Long

Negates this Long's value.

#negative Source

negative :: forall s. Long' s -> Boolean

#notEquals_ Source

notEquals_ :: Long -> Fn1 Long Boolean

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

#not_ Source

not_ :: Long -> Long

Returns the bitwise NOT of this Long.

#numberBitsToInt Source

#odd Source

odd :: forall s. Long' s -> Boolean

#one_ Source

one_ :: Long

Signed one

#or Source

or :: forall s. Long' s -> Long' s -> Long' s

#or_ Source

or_ :: Long -> Fn1 Long Long

Returns the bitwise OR of this Long and the specified.

#parity Source

parity :: forall s. Long' s -> Parity

Returns whether a Long' is Even or Odd.

#positive Source

positive :: forall s. Long' s -> Boolean

#quot Source

quot :: forall s. Semiring (Long' s) => Long' s -> Long' s -> Long' s

#rem Source

rem :: forall s. Semiring (Long' s) => Long' s -> Long' s -> Long' s

#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.

#shiftLeft_ Source

shiftLeft_ :: Long -> Fn1 Long Long

Returns this Long with bits shifted to the left 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.

#shiftRight_ Source

shiftRight_ :: Long -> Fn1 Long Long

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

#shl Source

shl :: forall s. Long' s -> Long' s -> Long' s

#shr Source

shr :: forall s. Long' s -> Long' s -> Long' s

#signedLongFromInt Source

#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 :: forall s. Long' s -> Number

Converts a Long' to a Number, possibly losing precision.

#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 :: forall s. Long' s -> String

#toStringAs Source

toStringAs :: forall s. Radix -> Long' s -> String

#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.

#unsafeFromInt Source

unsafeFromInt :: forall s. SInfo s => Int -> Long' s

#unsignedLongFromInt Source

#uone_ Source

uone_ :: Long

Unsigned one

#uzero_ Source

uzero_ :: Long

Unsigned zero

#xor Source

xor :: forall s. Long' s -> Long' s -> Long' s

#xor_ Source

xor_ :: Long -> Fn1 Long Long

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

#zero_ Source

zero_ :: Long

Signed zero

#zshr Source

zshr :: forall s. Long' s -> Long' s -> Long' s