Class containing helper functions for dealing with IEEE-754 floating point numbers.
More...
|
def | fuzzyCompare |
| Compare two floats to check if they are equal with a tolerance value. More...
|
|
def | clamp |
| Return the value clamped to a minimum and maximum value. More...
|
|
Class containing helper functions for dealing with IEEE-754 floating point numbers.
def UM.Math.Float.Float.clamp |
( |
|
f1 | ) |
|
|
static |
Return the value clamped to a minimum and maximum value.
- Parameters
-
f1 | float The value to clamp. |
minimum | float The minimum value. |
maximum | float The maximum value. |
- Returns
- float Minimum if f1 < minimum, maximum if f1 > maximum, else f1.
def UM.Math.Float.Float.fuzzyCompare |
( |
|
f1 | ) |
|
|
static |
Compare two floats to check if they are equal with a tolerance value.
This method will compare two floats and check whether they are equal to within a certain tolerance value.
- Parameters
-
f1 | float The first value to compare. |
f2 | float The second value to compare. |
tolerance | float The amount of tolerance used to consider the two numbers "equal". |
- Returns
- True if the two numbers are considered equal, False if not.
The documentation for this class was generated from the following file: