Method AreApproximatelyEqual
AreApproximatelyEqual(float, float)
Assert that two float expressions are approximately equal to each other, within a default tolerance. Throws an exception if the assertion fails.
Declaration
[Conditional("UNITY_ASSERTIONS")]
public static void AreApproximatelyEqual(float expected, float actual)
Parameters
Type | Name | Description |
---|---|---|
float | expected | The expected value of the float expression. |
float | actual | The actual value of the float expression. |
AreApproximatelyEqual(float, float, string)
Assert that two float expressions are approximately equal to each other, within a default tolerance. Throws an exception if the assertion fails.
Declaration
[Conditional("UNITY_ASSERTIONS")]
public static void AreApproximatelyEqual(float expected, float actual, string message)
Parameters
Type | Name | Description |
---|---|---|
float | expected | The expected value of the float expression. |
float | actual | The actual value of the float expression. |
string | message | If the assertion fails, this message will be logged. |
AreApproximatelyEqual(float, float, float)
Assert that two float expressions are approximately equal to each other, within a caller-provided tolerance. Throws an exception if the assertion fails.
Declaration
[Conditional("UNITY_ASSERTIONS")]
public static void AreApproximatelyEqual(float expected, float actual, float tolerance)
Parameters
Type | Name | Description |
---|---|---|
float | expected | The expected value of the float expression. |
float | actual | The actual value of the float expression. |
float | tolerance | The maximum absolute difference between |