# FloatComparer

> Creates an instance of the comparer.

## Definition

* **Type:** Constructor
* **Namespace:** [UnityEngine.Assertions.Comparers](/engine/6000.6/script-reference/unityengine/assertions/comparers.md)
* **Assembly:** UnityEngine.CoreModule

## FloatComparer()

Creates an instance of the comparer.

```csharp
public FloatComparer()
```

## FloatComparer(bool)

Creates an instance of the comparer.

```csharp
public FloatComparer(bool relative)
```

### Parameters

**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Should a relative check be used when comparing values? By default, an absolute check will be used.

## FloatComparer(float)

Creates an instance of the comparer.

```csharp
public FloatComparer(float error)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Allowed comparison error. By default, the [FloatComparer.kEpsilon](/engine/6000.6/script-reference/unityengine/assertions/comparers/floatcomparer/kepsilon.md) is used.

## FloatComparer(float, bool)

Creates an instance of the comparer.

```csharp
public FloatComparer(float error, bool relative)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Allowed comparison error. By default, the [FloatComparer.kEpsilon](/engine/6000.6/script-reference/unityengine/assertions/comparers/floatcomparer/kepsilon.md) is used.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Should a relative check be used when comparing values? By default, an absolute check will be used.
