# MustNotBeApproximatelyEqual

> An extension method for Assert.AreNotApproximatelyEqual.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Assertions.Must](/engine/6000.6/script-reference/unityengine/assertions/must.md)
* **Assembly:** UnityEngine.CoreModule

## MustNotBeApproximatelyEqual(float, float)

An extension method for [Assert.AreNotApproximatelyEqual](/engine/6000.6/script-reference/unityengine/assertions/assert/arenotapproximatelyequal.md).

> **Warning:**
>
> **Deprecated.** Must extensions are deprecated. Use UnityEngine.Assertions.Assert instead

```csharp
[Conditional("UNITY_ASSERTIONS")]
public static void MustNotBeApproximatelyEqual(this float actual, float expected)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): **** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)):&#x20;

### Examples

```csharp
using UnityEngine;
using UnityEngine.Assertions;
using UnityEngine.Assertions.Must;

public class AssertionExampleClass : MonoBehaviour
{
    Rigidbody rb;
    void Update()
    {
        //Make sure the rigidbody never stops.
        //AreNotApproximatelyEqual should be used for comparing floating point variables.
        //Unless specified, default error tolerance will be used.
        rb.velocity.magnitude.MustNotBeApproximatelyEqual(0.0f);
    }
}
```

## MustNotBeApproximatelyEqual(float, float, string)

An extension method for [Assert.AreNotApproximatelyEqual](/engine/6000.6/script-reference/unityengine/assertions/assert/arenotapproximatelyequal.md).

> **Warning:**
>
> **Deprecated.** Must extensions are deprecated. Use UnityEngine.Assertions.Assert instead

```csharp
[Conditional("UNITY_ASSERTIONS")]
public static void MustNotBeApproximatelyEqual(this float actual, float expected, string message)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): **** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): **** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)):&#x20;

### Examples

```csharp
using UnityEngine;
using UnityEngine.Assertions;
using UnityEngine.Assertions.Must;

public class AssertionExampleClass : MonoBehaviour
{
    Rigidbody rb;
    void Update()
    {
        //Make sure the rigidbody never stops.
        //AreNotApproximatelyEqual should be used for comparing floating point variables.
        //Unless specified, default error tolerance will be used.
        rb.velocity.magnitude.MustNotBeApproximatelyEqual(0.0f);
    }
}
```

## MustNotBeApproximatelyEqual(float, float, float)

An extension method for [Assert.AreNotApproximatelyEqual](/engine/6000.6/script-reference/unityengine/assertions/assert/arenotapproximatelyequal.md).

> **Warning:**
>
> **Deprecated.** Must extensions are deprecated. Use UnityEngine.Assertions.Assert instead

```csharp
[Conditional("UNITY_ASSERTIONS")]
public static void MustNotBeApproximatelyEqual(this float actual, float expected, float tolerance)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): **** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): **** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)):&#x20;

### Examples

```csharp
using UnityEngine;
using UnityEngine.Assertions;
using UnityEngine.Assertions.Must;

public class AssertionExampleClass : MonoBehaviour
{
    Rigidbody rb;
    void Update()
    {
        //Make sure the rigidbody never stops.
        //AreNotApproximatelyEqual should be used for comparing floating point variables.
        //Unless specified, default error tolerance will be used.
        rb.velocity.magnitude.MustNotBeApproximatelyEqual(0.0f);
    }
}
```

## MustNotBeApproximatelyEqual(float, float, float, string)

An extension method for [Assert.AreNotApproximatelyEqual](/engine/6000.6/script-reference/unityengine/assertions/assert/arenotapproximatelyequal.md).

> **Warning:**
>
> **Deprecated.** Must extensions are deprecated. Use UnityEngine.Assertions.Assert instead

```csharp
[Conditional("UNITY_ASSERTIONS")]
public static void MustNotBeApproximatelyEqual(this float actual, float expected, float tolerance, string message)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): **** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): **** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): **** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)):&#x20;

### Examples

```csharp
using UnityEngine;
using UnityEngine.Assertions;
using UnityEngine.Assertions.Must;

public class AssertionExampleClass : MonoBehaviour
{
    Rigidbody rb;
    void Update()
    {
        //Make sure the rigidbody never stops.
        //AreNotApproximatelyEqual should be used for comparing floating point variables.
        //Unless specified, default error tolerance will be used.
        rb.velocity.magnitude.MustNotBeApproximatelyEqual(0.0f);
    }
}
```
