Class Range
Some simple logic to pick a value from a range.
Inheritance
Namespace: GDX.Mathematics
Syntax
public static class Range
Methods
| Improve this Doc View SourceGetDouble(Double, Double, Double)
Returns the System.Double between minValue
and
maxValue
range at percent
.
Declaration
public static double GetDouble(double percent, double minValue = -1.7976931348623157E+308, double maxValue = 1.7976931348623157E+308)
Parameters
Type | Name | Description |
---|---|---|
System.Double | percent | The percentage (0-1) used to find a value in the range provided. |
System.Double | minValue | The lowest possible value. |
System.Double | maxValue | The highest possible value. |
Returns
Type | Description |
---|---|
System.Double | A System.Double value. |
GetInteger(Double, Int32, Int32)
Returns the System.Int32 between minValue
and
maxValue
range at percent
.
Declaration
public static int GetInteger(double percent, int minValue = -2147483648, int maxValue = 2147483647)
Parameters
Type | Name | Description |
---|---|---|
System.Double | percent | The percentage (0-1) used to find a value in the range provided. |
System.Int32 | minValue | The lowest possible value. |
System.Int32 | maxValue | The highest possible value. |
Returns
Type | Description |
---|---|
System.Int32 | The System.Int32 value. |
GetSingle(Double, Single, Single)
Returns the System.Single between minValue
and
maxValue
range at percent
.
Declaration
public static float GetSingle(double percent, float minValue = -3.40282347E+38F, float maxValue = 3.40282347E+38F)
Parameters
Type | Name | Description |
---|---|---|
System.Double | percent | The percentage (0-1) used to find a value in the range provided. |
System.Single | minValue | The lowest possible value. |
System.Single | maxValue | The highest possible value. |
Returns
Type | Description |
---|---|
System.Single | A System.Single value. |
GetUnsignedInteger(Double, UInt32, UInt32)
Returns the System.UInt32 between minValue
and
maxValue
range at percent
.
Declaration
public static uint GetUnsignedInteger(double percent, uint minValue = 0U, uint maxValue = 4294967295U)
Parameters
Type | Name | Description |
---|---|---|
System.Double | percent | The percentage (0-1) used to find a value in the range provided. |
System.UInt32 | minValue | The lowest possible value. |
System.UInt32 | maxValue | The highest possible value. |
Returns
Type | Description |
---|---|
System.UInt32 | A System.UInt32 value. |