[]
        
(Showing Draft Content)

C1.Util.DX.DXUtil.NearEqual

NearEqual Method

NearEqual(float, float)

Checks if a and b are almost equals, taking into account the magnitude of floating point numbers. See Remarks. See remarks.

Declaration
public static bool NearEqual(float a, float b)
Parameters
Type Name Description
float a

The left value to compare.

float b

The right value to compare.

Returns
Type Description
bool

true if a almost equal to b, false otherwise

Remarks

The code is using the technique described by Bruce Dawson in Comparing Floating point numbers 2012 edition.