Class containing helper functions for dealing with IEEE-754 floating point numbers.
More...
|
| fuzzyCompare (f1, f2, tolerance=1e-8) |
| Compare two floats to check if they are equal with a tolerance value.
|
|
| clamp (f1, minimum, maximum) |
| Return the value clamped to a minimum and maximum value.
|
|
Class containing helper functions for dealing with IEEE-754 floating point numbers.
◆ clamp()
UM.Math.Float.Float.clamp |
( |
|
f1, |
|
|
|
minimum, |
|
|
|
maximum |
|
) |
| |
|
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.
◆ fuzzyCompare()
UM.Math.Float.Float.fuzzyCompare |
( |
|
f1, |
|
|
|
f2, |
|
|
|
tolerance = 1e-8 |
|
) |
| |
|
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: