IntX extension

Core extensions on int adding parity checks, digits access, and iterative utilities.

on

Properties

digitCount → int

Available on int, provided by the IntX extension

Number of decimal digits (ignores sign).
no setter
digits → List<int>

Available on int, provided by the IntX extension

Individual digits, most-significant first.
no setter
isEven → bool

Available on int, provided by the IntX extension

Returns true if the number is even.
no setter
isOdd → bool

Available on int, provided by the IntX extension

Returns true if the number is odd.
no setter

Methods

isBetween(int min, int max) → bool

Available on int, provided by the IntX extension

Checks if the integer is between min and max inclusively.
times(void action()) → void

Available on int, provided by the IntX extension

Executes action times. Equivalent to a for loop.
to(int end, {int step = 1}) → Iterable<int>

Available on int, provided by the IntX extension

Inclusive range as a lazy iterable.