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. [...]
read-only, override
hashCode → int
Returns a hash code based on all the bits of this Int64.
read-only
isEven → bool
Returns true if and only if this integer is even.
read-only, override
isMaxValue → bool
Returns true if and only if this integer is the maximum signed value that can be represented within its bit size.
read-only, override
isMinValue → bool
Returns true if and only if this integer is the minimum signed value that can be represented within its bit size.
read-only, override
isNegative → bool
Returns true if and only if this integer is less than zero.
read-only, override
isOdd → bool
Returns true if and only if this integer is odd.
read-only, override
isZero → bool
Returns true if and only if this integer is zero.
read-only, override
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

abs() Int64
Returns the absolute value of this integer.
override
clamp(dynamic lowerLimit, dynamic upperLimit) Int64
Clamps this integer to be in the range lowerLimit - upperLimit.
override
compareTo(dynamic other) → int
Compares this object to another Comparable [...]
override
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(dynamic 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; example: '0xd'.
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.
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
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited

Operators

operator %(dynamic other) Int64
Euclidean modulo operator. [...]
override
operator &(dynamic other) Int64
Bitwise and operator.
override
operator *(dynamic other) Int64
Multiplication operator.
override
operator +(dynamic other) Int64
Addition operator.
override
operator -(dynamic other) Int64
Subtraction operator.
override
operator <(dynamic other) → bool
Relational less than operator.
override
operator <<(int n) Int64
Left bit-shift operator. [...]
override
operator <=(dynamic other) → bool
Relational less than or equal to operator.
override
operator ==(dynamic 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.
operator >(dynamic other) → bool
Relational greater than operator.
override
operator >=(dynamic other) → bool
Relational greater than or equal to operator.
override
operator >>(int n) Int64
Right bit-shift operator. [...]
override
operator ^(dynamic other) Int64
Bitwise xor operator.
override
operator unary-() Int64
Negate operator. [...]
override
operator |(dynamic other) Int64
Bitwise or operator.
override
operator ~() Int64
Bitwise negate operator.
override
operator ~/(dynamic other) Int64
Truncating division operator.
override

Static Methods

parseHex(String s) Int64
Parses a hexadecimal String and returns an Int64.
parseInt(String s) Int64
Parses a decimal String and returns an Int64.
parseRadix(String s, int radix) Int64
Parses a String in a given radix between 2 and 36 and returns an Int64.

Constants

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