Table of Contents

Class BoxedNumberComparer

Namespace
NCalc.Helpers
Assembly
NCalc.dll
public class BoxedNumberComparer : IComparer<object?>, IEqualityComparer<object?>
Inheritance
BoxedNumberComparer
Implements
Inherited Members

Constructors

BoxedNumberComparer(ComparisonOptions, MathHelperOptions)

public BoxedNumberComparer(ComparisonOptions comparisonOptions, MathHelperOptions mathHelperOptions)

Parameters

comparisonOptions ComparisonOptions
mathHelperOptions MathHelperOptions

Methods

Compare(object?, object?)

Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other.

public int Compare(object? x, object? y)

Parameters

x object

The first object to compare.

y object

The second object to compare.

Returns

int

A signed integer that indicates the relative values of x and y, as shown in the following table.

Value Meaning
Less than zerox is less than y.
Zerox equals y.
Greater than zerox is greater than y.

Equals(object?, object?)

Determines whether the specified objects are equal.

public bool Equals(object? x, object? y)

Parameters

x object

The first object of type T to compare.

y object

The second object of type T to compare.

Returns

bool

true if the specified objects are equal; otherwise, false.

GetHashCode(object?)

Returns a hash code for the specified object.

public int GetHashCode(object? obj)

Parameters

obj object

The object for which a hash code is to be returned.

Returns

int

A hash code for the specified object.

Exceptions

ArgumentNullException

The type of obj is a reference type and obj is null.