Table of Contents

Class FloatExtensions

Namespace
DotEx.Maths
Assembly
DotEx.dll

Extensions for float.

public static class FloatExtensions
Inheritance
FloatExtensions
Inherited Members

Methods

IsEqualApprox(float, float, float)

Checks if the two values are approximately equal.

public static bool IsEqualApprox(this float a, float b, float precision = 0.001)

Parameters

a float

First value.

b float

Second value.

precision float

Precision to use.

Returns

bool

True if the two values are approximately equal.

IsZeroApprox(float, float)

Checks if the value is approximately zero.

public static bool IsZeroApprox(this float value, float precision = 0.001)

Parameters

value float

Value to check.

precision float

Precision to use.

Returns

bool

True if the value is approximately zero.

Trim(float, float)

Trims value to a given precision.

public static float Trim(this float value, float precision = 0.001)

Parameters

value float

Value to trim.

precision float

Precision to use.

Returns

float

Trimmed value.

Exceptions

ArgumentOutOfRangeException

precision is not positive and smaller than 1.