Integer class
Properties
hashCode
→ int
Returns a hash code for a numerical value.
no setter override
isInfinite
→ bool
True if the number is infinite; otherwise, false.
no setter override
isNaN
→ bool
True if the number is not a number; otherwise, false.
no setter override
isNegative
→ bool
True if the number is negative; otherwise, false.
no setter override
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
sign
→ Integer
Returns minus one, zero or plus one depending on the sign and
numerical value of the number.
no setter override
value
↔ int
getter/setter pair
Methods
abs ()
→ Number
Returns the absolute value of this num .
override
ceil ()
→ Integer
Returns the least integer no smaller than this
.
override
compareTo (Number other )
→ int
Compares this to other
.
override
floor ()
→ Integer
Returns the greatest integer no greater than this
.
override
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remainder (Number other )
→ Number
Returns the remainder of the truncating division of this
by other
.
override
round ()
→ Integer
Returns the integer closest to this
.
override
roundWithPrecision (int precision , [RoundingMode mode = RoundingMode.nearestEven ])
→ Number
Returns number rounded according to precision
and RoundingMode .
override
toInt ()
→ int
Truncates this Number to an integer and returns the result as an int . */
override
toInteger ()
→ Integer
Truncates this Number to an integer and returns the result as an Integer .
override
toString ()
→ String
Returns the shortest string that correctly represent the input number.
override
toStringAsExponential ([int ? fractionDigits ])
→ String
Returns an exponential string-representation of this
.
override
toStringAsFixed (int fractionDigits )
→ String
Returns a decimal-point string-representation of this
.
Converts this
to a Decimal before computing the string representation.
If the absolute value of this
is greater or equal to 10^21
then this
methods returns an exponential representation computed by
this.toStringAsExponential()
. Otherwise the result
is the closest string representation with exactly fractionDigits
digits
after the decimal point. If fractionDigits
equals 0 then the decimal
point is omitted.
override
toStringAsPrecision (int precision )
→ String
Converts this
to a decimal and returns a string representation with
exactly precision
significant digits.
override
truncate ()
→ Integer
Returns the integer obtained by discarding any fractional
digits from this
.
override
expression_language 1.0.1