IntUtils class abstract final

IntUtils is a utility class in Dart that provides static methods for performing operations on integers. This class cannot be instantiated.

The methods in this class include, but are not limited to, methods for finding the greatest common denominator (GCD) of two integers using the Euclidean algorithm.

Example usage:

int gcd = IntUtils.findGCD(48, 18);  // returns 6

Note: All methods in this class are null-safe, meaning they will not throw an exception if the input integers are not within the expected range. Instead, they will return a reasonable default value (usually null).

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

findGreatestCommonDenominator(int a, int b, {int depth = 0, int maxDepth = _defaultMaxRecursionDepth}) int?
Returns the greatest common denominator of a and b, or null if the inputs are invalid or recursion exceeds maxDepth.