Assignment Search Framework
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
floating_point_utils.cpp File Reference

Functions

bool fp_less (double a, double b)
 
bool fp_greater (double a, double b)
 
bool fp_equal (double a, double b)
 
double fp_min (double a, double b)
 
double fp_max (double a, double b)
 

Function Documentation

bool fp_equal ( double  a,
double  b 
)

Returns if a is equal to b, given some tolerance due to floating point arithmetic.

Parameters
aThe left-hand operator of "=="
bThe right-hand operator of "=="
Returns
If the first number is equal to the second.
bool fp_greater ( double  a,
double  b 
)

Returns if a is greater than b, given some tolerance due to floating point arithmetic.

Parameters
aThe left-hand operator of ">"
bThe right-hand operator of ">"
Returns
If the first number is greater than the second.
bool fp_less ( double  a,
double  b 
)

Returns if a is less than b, given some tolerance due to floating point arithmetic.

Parameters
aThe left-hand operator of "<"
bThe right-hand operator of "<"
Returns
If the first number is less than the second.
double fp_max ( double  a,
double  b 
)

Returns the maximum of a and b, given some tolerance due to floating point arithmetic.

Parameters
aThe first value to take the maximum over.
bThe second value to take the maximum over.
Returns
The maximum of the two numbers
double fp_min ( double  a,
double  b 
)

Returns the minimum of a and b, given some tolerance due to floating point arithmetic.

Parameters
aThe first value to take the minimum over.
bThe second value to take the minimum over.
Returns
The minimum of the two numbers