Int64 class

An immutable 64-bit signed integer, in the range -2^63, 2^63 - 1. Arithmetic operations may overflow in order to maintain this range.

Implemented types

Constructors

Int64([int value = 0])
Constructs an Int64 with a given int value; zero by default.
factory
Int64.fromBytes(List<int> bytes)
factory
Int64.fromBytesBigEndian(List<int> bytes)
factory
Int64.fromInts(int top, int bottom)
Constructs an Int64 from a pair of 32-bit integers having the value ((top & 0xffffffff) << 32) | (bottom & 0xffffffff).
factory

Properties

bitLength int
Returns the minimum number of bits required to store this integer.
no setteroverride
hashCode int
Returns a hash code based on all the bits of this Int64.
no setteroverride
isEven bool
Returns true if and only if this integer is even.
no setteroverride
isMaxValue bool
Returns true if and only if this integer is the maximum signed value that can be represented within its bit size.
no setteroverride
isMinValue bool
Returns true if and only if this integer is the minimum signed value that can be represented within its bit size.
no setteroverride
isNegative bool
Returns true if and only if this integer is less than zero.
no setteroverride
isOdd bool
Returns true if and only if this integer is odd.
no setteroverride
isZero bool
Returns true if and only if this integer is zero.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

abs() Int64
Returns the absolute value of this integer.
override
clamp(Object lowerLimit, Object upperLimit) Int64
Clamps this integer to be in the range lowerLimit - upperLimit.
override
compareTo(Object other) int
Compares this object to another object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
numberOfLeadingZeros() int
Returns the number of leading zeros in this Int64 as an int between 0 and 64.
override
numberOfTrailingZeros() int
Returns the number of trailing zeros in this Int64 as an int between 0 and 64.
override
remainder(Object other) Int64
Returns the remainder of the truncating division of this integer by other.
override
shiftRightUnsigned(int n) Int64
Unsigned right-shift operator.
override
toBytes() List<int>
Returns a byte-sequence representation of this integer.
override
toDebugString() String
toDouble() double
Returns the double representation of this integer.
override
toHexString() String
Returns a string representing the value of this integer in hexadecimal notation.
override
toInt() int
Returns the int representation of this integer.
override
toInt32() Int32
Returns an Int32 containing the low 32 bits of this Int64.
override
toInt64() Int64
Returns this.
override
toRadixString(int radix) String
Returns a string representing the value of this integer in the given radix.
override
toRadixStringUnsigned(int radix) String
toSigned(int width) Int64
Returns the least significant width bits of this integer, extending the highest retained bit to the sign. This is the same as truncating the value to fit in width bits using an signed 2-s complement representation. The returned value has the same bit value in all positions higher than width.
override
toString() String
Returns the value of this Int64 as a decimal String.
override
toStringUnsigned() String
Returns the digits of this when interpreted as an unsigned 64-bit value.
toUnsigned(int width) Int64
Returns the least significant width bits of this integer as a non-negative number (i.e. unsigned representation). The returned value has zeros in all bit positions higher than width.
override

Operators

operator %(Object other) Int64
Euclidean modulo operator.
override
operator &(Object other) Int64
Bitwise and operator.
override
operator *(Object other) Int64
Multiplication operator.
override
operator +(Object other) Int64
Addition operator.
override
operator -(Object other) Int64
Subtraction operator.
override
operator <(Object other) bool
Relational less than operator.
override
operator <<(int n) Int64
Left bit-shift operator.
override
operator <=(Object other) bool
Relational less than or equal to operator.
override
operator ==(Object other) bool
Returns true if this Int64 has the same numeric value as the given object. The argument may be an int or an IntX.
override
operator >(Object other) bool
Relational greater than operator.
override
operator >=(Object other) bool
Relational greater than or equal to operator.
override
operator >>(int n) Int64
Right bit-shift operator.
override
operator ^(Object other) Int64
Bitwise xor operator.
override
operator unary-() Int64
Negate operator.
override
operator |(Object other) Int64
Bitwise or operator.
override
operator ~() Int64
Bitwise negate operator.
override
operator ~/(Object other) Int64
Truncating division operator.
override

Static Methods

parseHex(String source) Int64
Parses source as a hexadecimal numeral.
parseInt(String source) Int64
Parses source as a decimal numeral.
parseRadix(String source, int radix) Int64
Parses source in a given radix between 2 and 36.
tryParseHex(String source) Int64?
Parses source as a hexadecimal numeral.
tryParseInt(String source) Int64?
Parses source as a decimal numeral.
tryParseRadix(String source, int radix) Int64?
Parses source in a given radix between 2 and 36.

Constants

MAX_VALUE → const Int64
The maximum positive value attainable by an Int64, namely 9,223,372,036,854,775,807.
MIN_VALUE → const Int64
The minimum positive value attainable by an Int64, namely -9,223,372,036,854,775,808.
ONE → const Int64
An Int64 constant equal to 1.
TWO → const Int64
An Int64 constant equal to 2.
ZERO → const Int64
An Int64 constant equal to 0.