Class MathUtils
Provides math-related utility functions.
Assembly: NanoByte.Common.dll
Syntax
public static class MathUtils : Object
Methods
EqualsTolerance(Double, Double, Double)
Compares two floating-point values for equality, allowing for a certain tolerance
.
Declaration
public static bool EqualsTolerance(this double a, double b, double tolerance = 1E-05)
Parameters
Returns
EqualsTolerance(Single, Single, Single)
Compares two floating-point values for equality, allowing for a certain tolerance
.
Declaration
public static bool EqualsTolerance(this float a, float b, float tolerance = 1E-05F)
Parameters
Returns
Modulo(Int32, Int32)
Calculates the mathematical modulo of a value.
Declaration
public static int Modulo(this int value, int modulo)
Parameters
Returns
Modulo(Int64, Int64)
Calculates the mathematical modulo of a value.
Declaration
public static long Modulo(this long value, long modulo)
Parameters
Returns
MultiplyAndRound(Size, SizeF)
Multiplies a Size with a SizeF and then rounds the components to integer values.
Declaration
public static Size MultiplyAndRound(this Size size, SizeF factor)
Parameters
Returns