XMScalarNearEqual function (directxmath.h)

Determines if two floating-point values are nearly equal.

Syntax

bool XMScalarNearEqual(
  [in] float S1,
  [in] float S2,
  [in] float Epsilon
) noexcept;

Parameters

[in] S1

First floating-point value to compare.

[in] S2

Second floating-point value to compare.

[in] Epsilon

Tolerance to use when comparing S1 and S2.

Return value

Returns true if the absolute value of the difference between S1 and S2 is less than or equal to Epsilon. Returns false otherwise.

Remarks

Platform Requirements

Microsoft Visual Studio 2010 or Microsoft Visual Studio 2012 with the Windows SDK for Windows 8. Supported for Win32 desktop apps, Windows Store apps, and Windows Phone 8 apps.

Requirements

Requirement Value
Target Platform Windows
Header directxmath.h

See also

DirectXMath Library Scalar Functions