Function Macro

GLibAPPROX_VALUE

Declaration

#define G_APPROX_VALUE (
  a,
  b,
  epsilon
)

Description

Evaluates to a truth value if the absolute difference between a and b is smaller than epsilon, and to a false value otherwise.

For example, - G_APPROX_VALUE (5, 6, 2) evaluates to true - G_APPROX_VALUE (3.14, 3.15, 0.001) evaluates to false - G_APPROX_VALUE (n, 0.f, FLT_EPSILON) evaluates to true if n is within the single precision floating point epsilon from zero.

Available since:2.58

Parameters

a none
 

A numeric value.

b none
 

A numeric value.

epsilon none
 

A numeric value that expresses the tolerance between a and b.