Integers extension

Utilities for handling overflows.

on

Methods

addOverflows(int other) bool
Checks if the addition of this and other causes an overflow.
subtractOverflows(int other) bool
Checks if the subtraction of other from this causes an overflow.
toBool() bool
Returns true if this integer is greater than 0. Otherwise returns false.

Static Methods

from(bool value) int
Returns 1 if the given value is true. Otherwise returns 0.

Constants

max → const int
The maximum platform-independent value.
min → const int
The minimum platform-independent value.