abs method
Returns the absolute value of this integer.
For any integer value
,
the result is the same as value < 0 ? -value : value
.
Integer overflow may cause the result of -value
to stay negative.
Implementation
int? abs() => value?.abs();
Returns the absolute value of this integer.
For any integer value
,
the result is the same as value < 0 ? -value : value
.
Integer overflow may cause the result of -value
to stay negative.
int? abs() => value?.abs();