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 setter
- 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 setter - isMaxValue → bool
-
Returns
true
if and only if this integer is the maximum signed value that can be represented within its bit size.no setter - isMinValue → bool
-
Returns
true
if and only if this integer is the minimum signed value that can be represented within its bit size.no setter - isNegative → bool
-
Returns
true
if and only if this integer is less than zero.no setter - isOdd → bool
-
Returns
true
if and only if this integer is odd.no setter - isZero → bool
-
Returns
true
if and only if this integer is zero.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
abs(
) → Int64 - Returns the absolute value of this integer.
-
clamp(
Object lowerLimit, Object upperLimit) → Int64 -
Clamps this integer to be in the range
lowerLimit
-upperLimit
. -
compareTo(
Object other) → int - Compares this object to another object.
-
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.
-
numberOfTrailingZeros(
) → int - Returns the number of trailing zeros in this Int64 as an int between 0 and 64.
-
remainder(
Object other) → Int64 -
Returns the remainder of the truncating division of this integer by
other
. -
shiftRightUnsigned(
int n) → Int64 - Unsigned right-shift operator.
-
toBytes(
) → List< int> - Returns a byte-sequence representation of this integer.
-
toDebugString(
) → String -
toDouble(
) → double - Returns the double representation of this integer.
-
toHexString(
) → String - Returns a string representing the value of this integer in hexadecimal notation.
-
toInt(
) → int - Returns the int representation of this integer.
-
toInt32(
) → Int32 -
Returns an
Int32
containing the low 32 bits of this Int64. -
toInt64(
) → Int64 -
Returns
this
. -
toRadixString(
int radix) → String - Returns a string representing the value of this integer in the given radix.
-
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 inwidth
bits using an signed 2-s complement representation. The returned value has the same bit value in all positions higher thanwidth
. -
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 thanwidth
.
Operators
-
operator %(
Object other) → Int64 - Euclidean modulo operator.
-
operator &(
Object other) → Int64 - Bitwise and operator.
-
operator *(
Object other) → Int64 - Multiplication operator.
-
operator +(
Object other) → Int64 - Addition operator.
-
operator -(
Object other) → Int64 - Subtraction operator.
-
operator <(
Object other) → bool - Relational less than operator.
-
operator <<(
int n) → Int64 - Left bit-shift operator.
-
operator <=(
Object other) → bool - Relational less than or equal to operator.
-
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 anIntX
.override -
operator >(
Object other) → bool - Relational greater than operator.
-
operator >=(
Object other) → bool - Relational greater than or equal to operator.
-
operator >>(
int n) → Int64 - Right bit-shift operator.
-
operator ^(
Object other) → Int64 - Bitwise xor operator.
-
operator unary-(
) → Int64 - Negate operator.
-
operator |(
Object other) → Int64 - Bitwise or operator.
-
operator ~(
) → Int64 - Bitwise negate operator.
-
operator ~/(
Object other) → Int64 - Truncating division operator.
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 givenradix
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 givenradix
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.