Edit

Share via


DoubleExtensions.Approximately(Double, Double, Double) Method

Definition

Checks if two numbers are approximately equal. Similar to Mathf.Approximately(float, float), but the tolerance can be specified.

public:
[System::Runtime::CompilerServices::Extension]
 static bool Approximately(double number, double other, double tolerance);
public static bool Approximately (this double number, double other, double tolerance);
static member Approximately : double * double * double -> bool
<Extension()>
Public Function Approximately (number As Double, other As Double, tolerance As Double) As Boolean

Parameters

number
Double

One of the numbers to compare.

other
Double

The other number to compare.

tolerance
Double

The amount of tolerance to allow while still considering the numbers approximately equal.

Returns

True if the difference between the numbers is less than or equal to the tolerance, false otherwise.

Applies to