Int64

GitHub   Edit on GitHub

Utilities for working with the Int64 type.

Added in 0.2.0 No other changes yet.
1
import Int64 from "int64"

Conversions

Functions for converting between Numbers and the Int64 type.

Int64.fromNumber

Added in 0.2.0 No other changes yet.
1
fromNumber : Number -> Int64

Converts a Number to an Int64.

Parameters:

param type description
number Number The value to convert

Returns:

type description
Int64 The Number represented as an Int64

Int64.toNumber

Added in 0.2.0 No other changes yet.
1
toNumber : Int64 -> Number

Converts an Int64 to a Number.

Parameters:

param type description
value Int64 The value to convert

Returns:

type description
Number The Int64 represented as a Number

Operations

Mathematical operations for Int64 values.

Int64.incr

Added in 0.2.0 No other changes yet.
1
incr : Int64 -> Int64

Increments the value by one.

Parameters:

param type description
value Int64 The value to increment

Returns:

type description
Int64 The incremented value

Int64.decr

Added in 0.2.0 No other changes yet.
1
decr : Int64 -> Int64

Decrements the value by one.

Parameters:

param type description
value Int64 The value to decrement

Returns:

type description
Int64 The decremented value

Int64.add

Added in 0.2.0 No other changes yet.
1
add : (Int64, Int64) -> Int64

Computes the sum of its operands.

Parameters:

param type description
x Int64 The first operand
y Int64 The second operand

Returns:

type description
Int64 The sum of the two operands

Int64.sub

Added in 0.2.0 No other changes yet.
1
sub : (Int64, Int64) -> Int64

Computes the difference of its operands.

Parameters:

param type description
x Int64 The first operand
y Int64 The second operand

Returns:

type description
Int64 The difference of the two operands

Int64.mul

Added in 0.2.0 No other changes yet.
1
mul : (Int64, Int64) -> Int64

Computes the product of its operands.

Parameters:

param type description
x Int64 The first operand
y Int64 The second operand

Returns:

type description
Int64 The product of the two operands

Int64.div

Added in 0.2.0 No other changes yet.
1
div : (Int64, Int64) -> Int64

Computes the quotient of its operands using signed division.

Parameters:

param type description
x Int64 The first operand
y Int64 The second operand

Returns:

type description
Int64 The quotient of its operands

Int64.divU

Added in 0.2.0 No other changes yet.
1
divU : (Int64, Int64) -> Int64

Computes the quotient of its operands using unsigned division.

Parameters:

param type description
x Int64 The first operand
y Int64 The second operand

Returns:

type description
Int64 The quotient of its operands

Int64.rem

Added in 0.2.0 No other changes yet.
1
rem : (Int64, Int64) -> Int64

Computes the remainder of the division of its operands using signed division.

Parameters:

param type description
x Int64 The first operand
y Int64 The second operand

Returns:

type description
Int64 The remainder of its operands

Int64.remU

Added in 0.2.0 No other changes yet.
1
remU : (Int64, Int64) -> Int64

Computes the remainder of the division of its operands using unsigned division.

Parameters:

param type description
x Int64 The first operand
y Int64 The second operand

Returns:

type description
Int64 The remainder of its operands

Int64.mod

Added in 0.2.0 No other changes yet.
1
mod : (Int64, Int64) -> Int64

Computes the remainder of the division of the first operand by the second. The result will have the sign of the second operand.

Parameters:

param type description
x Int64 The first operand
y Int64 The second operand

Returns:

type description
Int64 The modulus of its operands

Throws:

ModuloByZero

  • When y is zero

Bitwise operations

Functions for operating on bits of Int64 values.

Int64.rotl

Added in 0.4.0 No other changes yet.
1
rotl : (Int64, Int64) -> Int64

Rotates the bits of the value left by the given number of bits.

Parameters:

param type description
value Int64 The value to rotate
amount Int64 The number of bits to rotate by

Returns:

type description
Int64 The rotated value

Int64.rotr

Added in 0.4.0 No other changes yet.
1
rotr : (Int64, Int64) -> Int64

Rotates the bits of the value right by the given number of bits.

Parameters:

param type description
value Int64 The value to rotate
amount Int64 The number of bits to rotate by

Returns:

type description
Int64 The rotated value

Int64.shl

Added in 0.2.0 No other changes yet.
1
shl : (Int64, Int64) -> Int64

Shifts the bits of the value left by the given number of bits.

Parameters:

param type description
value Int64 The value to shift
amount Int64 The number of bits to shift by

Returns:

type description
Int64 The shifted value

Int64.shr

Added in 0.2.0 No other changes yet.
1
shr : (Int64, Int64) -> Int64

Shifts the bits of the value right by the given number of bits, preserving the sign bit.

Parameters:

param type description
value Int64 The value to shift
amount Int64 The amount to shift by

Returns:

type description
Int64 The shifted value

Int64.shrU

Added in 0.2.0 No other changes yet.
1
shrU : (Int64, Int64) -> Int64

Shifts the bits of the value right by the given number of bits.

Parameters:

param type description
value Int64 The value to shift
amount Int64 The amount to shift by

Returns:

type description
Int64 The shifted value

Comparisons

Functions for comparing Int64 values.

Int64.eq

Added in 0.4.0 No other changes yet.
1
eq : (Int64, Int64) -> Bool

Checks if the first value is equal to the second value.

Parameters:

param type description
x Int64 The first value
y Int64 The second value

Returns:

type description
Bool true if the first value is equal to the second value or false otherwise

Int64.ne

Added in 0.4.0 No other changes yet.
1
ne : (Int64, Int64) -> Bool

Checks if the first value is not equal to the second value.

Parameters:

param type description
x Int64 The first value
y Int64 The second value

Returns:

type description
Bool true if the first value is not equal to the second value or false otherwise

Int64.eqz

Added in 0.4.0 No other changes yet.
1
eqz : Int64 -> Bool

Checks if the given value is equal to zero.

Parameters:

param type description
value Int64 The value to inspect

Returns:

type description
Bool true if the first value is equal to zero or false otherwise

Int64.lt

Added in 0.2.0 No other changes yet.
1
lt : (Int64, Int64) -> Bool

Checks if the first value is less than the second value.

Parameters:

param type description
x Int64 The first value
y Int64 The second value

Returns:

type description
Bool true if the first value is less than the second value or false otherwise

Int64.ltU

Added in 0.5.0 No other changes yet.
1
ltU : (Int64, Int64) -> Bool

Checks if the first unsigned value is less than the second unsigned value.

Parameters:

param type description
x Int64 The first value
y Int64 The second value

Returns:

type description
Bool true if the first value is less than the second value or false otherwise

Int64.gt

Added in 0.2.0 No other changes yet.
1
gt : (Int64, Int64) -> Bool

Checks if the first value is greater than the second value.

Parameters:

param type description
x Int64 The first value
y Int64 The second value

Returns:

type description
Bool true if the first value is greater than the second value or false otherwise

Int64.gtU

Added in 0.5.0 No other changes yet.
1
gtU : (Int64, Int64) -> Bool

Checks if the first unsigned value is greater than the second unsigned value.

Parameters:

param type description
x Int64 The first value
y Int64 The second value

Returns:

type description
Bool true if the first value is greater than the second value or false otherwise

Int64.lte

Added in 0.2.0 No other changes yet.
1
lte : (Int64, Int64) -> Bool

Checks if the first value is less than or equal to the second value.

Parameters:

param type description
x Int64 The first value
y Int64 The second value

Returns:

type description
Bool true if the first value is less than or equal to the second value or false otherwise

Int64.lteU

Added in 0.5.0 No other changes yet.
1
lteU : (Int64, Int64) -> Bool

Checks if the first unsigned value is less than or equal to the second unsigned value.

Parameters:

param type description
x Int64 The first value
y Int64 The second value

Returns:

type description
Bool true if the first value is less than or equal to the second value or false otherwise

Int64.gte

Added in 0.2.0 No other changes yet.
1
gte : (Int64, Int64) -> Bool

Checks if the first value is greater than or equal to the second value.

Parameters:

param type description
x Int64 The first value
y Int64 The second value

Returns:

type description
Bool true if the first value is greater than or equal to the second value or false otherwise

Int64.gteU

Added in 0.5.0 No other changes yet.
1
gteU : (Int64, Int64) -> Bool

Checks if the first unsigned value is greater than or equal to the second unsigned value.

Parameters:

param type description
x Int64 The first value
y Int64 The second value

Returns:

type description
Bool true if the first value is greater than or equal to the second value or false otherwise

Bitwise logic

Boolean operations on the bits of Int64 values.

Int64.lnot

Added in 0.2.0 No other changes yet.
1
lnot : Int64 -> Int64

Computes the bitwise NOT of the given value.

Parameters:

param type description
value Int64 The given value

Returns:

type description
Int64 Containing the inverted bits of the given value

Int64.land

Added in 0.2.0 No other changes yet.
1
land : (Int64, Int64) -> Int64

Computes the bitwise AND (&) on the given operands.

Parameters:

param type description
x Int64 The first operand
y Int64 The second operand

Returns:

type description
Int64 Containing a 1 in each bit position for which the corresponding bits of both operands are 1

Int64.lor

Added in 0.2.0 No other changes yet.
1
lor : (Int64, Int64) -> Int64

Computes the bitwise OR (|) on the given operands.

Parameters:

param type description
x Int64 The first operand
y Int64 The second operand

Returns:

type description
Int64 Containing a 1 in each bit position for which the corresponding bits of either or both operands are 1

Int64.lxor

Added in 0.2.0 No other changes yet.
1
lxor : (Int64, Int64) -> Int64

Computes the bitwise XOR (^) on the given operands.

Parameters:

param type description
x Int64 The first operand
y Int64 The second operand

Returns:

type description
Int64 Containing a 1 in each bit position for which the corresponding bits of either but not both operands are 1

Int64.clz

Added in 0.4.0 No other changes yet.
1
clz : Int64 -> Int64

Counts the number of leading zero bits in the value.

Parameters:

param type description
value Int64 The value to inspect

Returns:

type description
Int64 The amount of leading zeros

Int64.ctz

Added in 0.4.0 No other changes yet.
1
ctz : Int64 -> Int64

Counts the number of trailing zero bits in the value.

Parameters:

param type description
value Int64 The value to inspect

Returns:

type description
Int64 The amount of trailing zeros

Int64.popcnt

Added in 0.4.0 No other changes yet.
1
popcnt : Int64 -> Int64

Counts the number of bits set to 1 in the value, also known as a population count.

Parameters:

param type description
value Int64 The value to inspect

Returns:

type description
Int64 The amount of 1-bits in its operand
This is a notification!