ClassRadMath
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
AreClose(double, double, double)
Determines whether two double values are approximately equal within the specified epsilon tolerance.
Declaration
public static bool AreClose(double num1, double num2, double epsilon = 0.001)
Parameters
num1
The first number to compare.
num2
The second number to compare.
epsilon
The 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.
AreClose2(double, double, double)
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.
Declaration
public static bool AreClose2(double num1, double num2, double epsilon = 0.001)
Parameters
num1
The first number to compare.
num2
The second number to compare.
epsilon
The 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.
IsInRange<T>(T, T, T)
Determines whether a value is within the specified range (inclusive).
Declaration
public static bool IsInRange<T>(T value, T min, T max) where T : IComparable
Parameters
value
T
The value to check.
min
T
The minimum value of the range (inclusive).
max
T
The maximum value of the range (inclusive).
Returns
true if the value is within the range [min, max]; otherwise, false.