RadMath
Provides mathematical utility methods and constants. This static class contains various mathematical operations, comparisons, conversions, and calculations.
Definition
Namespace:Telerik.Maui
Assembly:Telerik.Maui.Core.dll
Syntax:
public static class RadMath
Inheritance: objectRadMath
Fields
Methods
Determines whether two double values are approximately equal within the specified epsilon tolerance.
public static bool AreClose(double num1, double num2, double epsilon = 0.001)
The first number to compare.
num2doubleThe second number to compare.
epsilondoubleThe epsilon tolerance for the comparison. Defaults to Epsilon.
Returns:true if the absolute difference between the numbers is less than or equal to epsilon; otherwise, false.
Determines whether two double values are approximately equal using relative epsilon comparison. This method uses the relative difference between the numbers divided by their sum.
public static bool AreClose2(double num1, double num2, double epsilon = 0.001)
The first number to compare.
num2doubleThe second number to compare.
epsilondoubleThe epsilon tolerance for the comparison. Defaults to Epsilon.
Returns:true if the relative difference between the numbers is less than or equal to epsilon; otherwise, false.
Determines whether a value is within the specified range (inclusive).
public static bool IsInRange<T>(T value, T min, T max) where T : IComparable
The value to check.
minTThe minimum value of the range (inclusive).
maxTThe maximum value of the range (inclusive).
Returns:true if the value is within the range [min, max]; otherwise, false.