Edit

Share via


Tolerance Class

Definition

The Tolerance class generalizes the notion of a tolerance within which an equality test succeeds. Normally, it is used with numeric types, but it can be used with any type that supports taking a difference between two objects and comparing that difference to a value.

public class Tolerance
type Tolerance = class
Inheritance
Tolerance

Constructors

Tolerance(Object)

Constructs a linear tolerance of a specdified amount

Properties

Days

Returns a new tolerance with a TimeSpan as the amount, using the current amount as a number of days.

Empty

Returns an empty Tolerance object, equivalent to specifying an exact match.

Hours

Returns a new tolerance with a TimeSpan as the amount, using the current amount as a number of hours.

IsEmpty

Returns true if the current tolerance is empty.

Milliseconds

Returns a new tolerance with a TimeSpan as the amount, using the current amount as a number of milliseconds.

Minutes

Returns a new tolerance with a TimeSpan as the amount, using the current amount as a number of minutes.

Mode

Gets the ToleranceMode for the current Tolerance

Percent

Returns a new tolerance, using the current amount as a percentage.

Seconds

Returns a new tolerance with a TimeSpan as the amount, using the current amount as a number of seconds.

Ticks

Returns a new tolerance with a TimeSpan as the amount, using the current amount as a number of clock ticks.

Ulps

Returns a new tolerance, using the current amount in Ulps.

Value

Gets the value of the current Tolerance instance.

Zero

Applies to