Uranium
Application Framework
UM.Math.Float.Float Class Reference

Class containing helper functions for dealing with IEEE-754 floating point numbers. More...

Static Public Member Functions

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...
 

Detailed Description

Class containing helper functions for dealing with IEEE-754 floating point numbers.

Member Function Documentation

def UM.Math.Float.Float.clamp (   f1)
static

Return the value clamped to a minimum and maximum value.

Parameters
f1float The value to clamp.
minimumfloat The minimum value.
maximumfloat 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
f1float The first value to compare.
f2float The second value to compare.
tolerancefloat 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: