NumbersHelper class abstract

A utility class for numerical helper methods.

Constructors

NumbersHelper()

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

gcd(int a, int b) int
Calculates the greatest common divisor (GCD) of two integers a and b.
isPerfectSquare(int n) bool
Checks if a number n is a perfect square.
mean(List<num> values) num
Calculates the mean of a list of values.
median(List<num> values) num
Calculates the median of a list of values.
mode(List<num> values) List<num>
Finds the mode(s) of a list of values.
percentile(List<num> values, double percentile) num
Calculates the specified percentile of a list of values.
safeDivide(num a, num b, {num whenBothZero = 0, num whenDivByZero = double.infinity, bool returnNaNOnDivByZero = false}) double
Safely divides two numbers with custom handling for division by zero and zero values.
standardDeviation(List<num> values) num
Calculates the standard deviation of a list of values.
variance(List<num> values) num
Calculates the variance of a list of values.