ComponentOne Bitmap for WinForms
C1.Win.C1DX.4.8 Assembly / C1.Util.DX Namespace / DXUtil Class / NearEqual Method
The left value to compare.
The right value to compare.

In This Topic
    NearEqual Method
    In This Topic
    Checks if a and b are almost equals, taking into account the magnitude of floating point numbers. See Remarks. See remarks.
    Syntax
    'Declaration
     
    Public Shared Function NearEqual( _
       ByVal a As System.Single, _
       ByVal b As System.Single _
    ) As System.Boolean
    public static System.bool NearEqual( 
       System.float a,
       System.float b
    )

    Parameters

    a
    The left value to compare.
    b
    The right value to compare.

    Return Value

    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.
    See Also