Table of Contents

Method AreClose

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

AreClose(double, double)

Determines whether two double values are equal using a layered comparison strategy. This method combines magnitude-scaled epsilon comparison, bitwise proximity (with default step threshold), and relative/absolute tolerance checks. It is suitable for robust floating-point validation across domains such as diagnostics, serialization, and numerical correctness.

public static bool AreClose(double a, double b)

Parameters

a double

The first double value to compare.

b double

The second double value to compare.

Returns

bool

true if any of the following conditions are met:

Otherwise, false.

AreClose(float, float)

Determines whether two float values are equal using a layered comparison strategy. This method combines magnitude-scaled epsilon comparison, bitwise proximity (with default step threshold), and relative/absolute tolerance checks. It is suitable for robust floating-point validation across domains such as diagnostics, serialization, and numerical correctness.

public static bool AreClose(float a, float b)

Parameters

a float

The first float value to compare.

b float

The second float value to compare.

Returns

bool

true if any of the following conditions are met:

Otherwise, false.