Polarith AI
1.8

◆ Approximately()

static bool Approximately ( float  a,
float  b 
)
static

Compares two floating point values if they are similar.

Due to floating point imprecision it is not recommended to compare floats using the equal operator, e.g. 1f + 0.0000001f == 1.0000001f might not return true on certain machines. The Epsilon constant is used as precision threshold.

Parameters
aFirst number to compare b with.
bSecond number to compare a with.
Returns
true: if the two given numbers are approximately equal. false: otherwise.
Imprint