Int¶
No import is needed.
Read the usage guide for examples and common tasks. This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation.
compare¶
Orders this value against other: negative when less, zero when equal, positive when greater. Implementing Comparable<int> lets List<int>.sort() / binary_search work out of the box.
abs¶
Absolute value of this integer.
min¶
The smaller of this and other.
max¶
The larger of this and other.
clamp¶
This value constrained to the inclusive range [lo, hi].
pow¶
This value raised to a non-negative integer power (exponents <= 0 yield 1).
signum¶
The sign of this value: -1, 0, or 1.
parse¶
Parses a (possibly signed) decimal integer from text.