MyScript Interactive Ink SDK 4.4.2
Static Public Member Functions | List of all members
myscript::iink::MathUtils Class Reference

#include <MathUtils.h>

Static Public Member Functions

static bool isNear (float x, float y, float absolute_tolerance, float relative_tolerance)
 
static bool isNear (float x, float y)
 
static bool isNear (double x, double y, double absolute_tolerance, double relative_tolerance)
 
static bool isNear (double x, double y)
 

Detailed Description

Set of utility functions to compare floating point values.

Member Function Documentation

◆ isNear() [1/4]

static bool myscript::iink::MathUtils::isNear ( float  x,
float  y,
float  absolute_tolerance,
float  relative_tolerance 
)
static

Compares two values and returns true if they are near each other.

Parameters
xthe first value to compare.
ythe second value to compare.
absolute_tolerancethe absolute tolerance for the comparison.
relative_tolerancethe relative tolerance for the comparison.
Returns
true if x and y are near, false otherwise.

◆ isNear() [2/4]

static bool myscript::iink::MathUtils::isNear ( float  x,
float  y 
)
static

Compares two values and returns true if they are near each other. Tolerance is the the difference between 1.0 and the next representable value of the given floating-point type.

Parameters
xthe first value to compare.
ythe second value to compare.
Returns
true if x and y are near, false otherwise.

◆ isNear() [3/4]

static bool myscript::iink::MathUtils::isNear ( double  x,
double  y,
double  absolute_tolerance,
double  relative_tolerance 
)
static

Compares two values and returns true if they are near each other.

Parameters
xthe first value to compare.
ythe second value to compare.
absolute_tolerancethe absolute tolerance for the comparison.
relative_tolerancethe relative tolerance for the comparison.
Returns
true if x and y are near, false otherwise.

◆ isNear() [4/4]

static bool myscript::iink::MathUtils::isNear ( double  x,
double  y 
)
static

Compares two values and returns true if they are near each other. Tolerance is the the difference between 1.0 and the next representable value of the given double-point type.

Parameters
xthe first value to compare.
ythe second value to compare.
Returns
true if x and y are near, false otherwise.

The documentation for this class was generated from the following file: