Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


FloatComparer

A float comparer used by Assert performing approximate comparison.
Read time 1 minuteLast updated 6 days ago

Definition

public class FloatComparer : IEqualityComparer<float>

Static Fields

Value

Description

kEpsilonDefault epsilon used by the comparer.
s_ComparerWithDefaultToleranceDefault instance of a comparer class with default error epsilon and absolute error check.

Constructors

Constructor

Description

FloatComparer()Creates an instance of the comparer.
FloatComparer(System.Boolean)Creates an instance of the comparer.
FloatComparer(System.Single)Creates an instance of the comparer.
FloatComparer(System.Single,System.Boolean)Creates an instance of the comparer.

Static Methods

Method

Description

AreEqualPerforms equality check with absolute error check.
AreEqualRelativePerforms equality check with relative error check.