Int32 class Null safety

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

Implemented types

Constructors

Int32([int i = 0])
Constructs an Int32 from an int. Only the low 32 bits of the input are used.

Properties

bitLength int
Returns the minimum number of bits required to store this integer. [...]
read-only, override
hashCode int
The hash code for this object. [...]
read-only, override
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() Int32
Returns the absolute value of this integer.
override
clamp(Object lowerLimit, Object upperLimit) Int32
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 non-existent method or property is accessed. [...]
inherited
numberOfLeadingZeros() int
Returns the number of high-order zeros in this integer's bit representation.
override
numberOfTrailingZeros() int
Returns the number of low-order zeros in this integer's bit representation.
override
remainder(Object other) Int32
Returns the remainder of the truncating division of this integer by other.
override
shiftRightUnsigned(int n) Int32
Unsigned right-shift operator. [...]
override
toBytes() List<int>
Returns a byte-sequence representation of this integer. [...]
override
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 representation of this integer. [...]
override
toInt64() Int64
Returns an Int64 representation of this integer.
override
toRadixString(int radix) String
Returns a string representing the value of this integer in the given radix. [...]
override
toSigned(int width) Int32
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
A string representation of this object. [...]
override
toUnsigned(int width) Int32
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) Int32
Euclidean modulo operator. [...]
override
operator &(Object other) Int32
Bitwise and operator.
override
operator *(Object other) IntX
Multiplication operator.
override
operator +(Object other) IntX
Addition operator.
override
operator -(Object other) IntX
Subtraction operator.
override
operator <(Object other) bool
Relational less than operator.
override
operator <<(int n) Int32
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 Int32 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) Int32
Right bit-shift operator. [...]
override
operator ^(Object other) Int32
Bitwise xor operator.
override
operator unary-() Int32
Negate operator. [...]
override
operator |(Object other) Int32
Bitwise or operator.
override
operator ~() Int32
Bitwise negate operator.
override
operator ~/(Object other) Int32
Truncating division operator.
override

Static Methods

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

Constants

MAX_VALUE → const Int32
The maximum positive value attainable by an Int32, namely 2147483647.
const Int32._internal(0x7FFFFFFF)
MIN_VALUE → const Int32
The minimum positive value attainable by an Int32, namely -2147483648.
const Int32._internal(-0x80000000)
ONE → const Int32
An Int32 constant equal to 1.
const Int32._internal(1)
TWO → const Int32
An Int32 constant equal to 2.
const Int32._internal(2)
ZERO → const Int32
An Int32 constant equal to 0.
const Int32._internal(0)