Skip to main content

Class NumericExtensions

A static class that provides numeric helper extension methods

Assembly: Meadow.Foundation.dll
View Source
Declaration
public static class NumericExtensions

Methods

Clamp(float, float, float)

Clamps a float (note: min and max are not currently used)

View Source
Declaration
public static float Clamp(this float self, float min, float max)
Returns

System.Single

Parameters
TypeName
System.Singleself
System.Singlemin
System.Singlemax

Clamp(double, double, double)

Clamps a double

View Source
Declaration
public static double Clamp(this double self, double min, double max)
Returns

System.Double

Parameters
TypeName
System.Doubleself
System.Doublemin
System.Doublemax

Clamp(int, int, int)

Clamps an int

View Source
Declaration
public static int Clamp(this int self, int min, int max)
Returns

System.Int32

Parameters
TypeName
System.Int32self
System.Int32min
System.Int32max