Table of Contents

Struct Number

Namespace
SixLabors.ImageSharp
Assembly
SixLabors.ImageSharp.dll

Represents an integral number.

public struct Number : IEquatable<Number>, IComparable<Number>
Implements
Inherited Members

Constructors

Number(int)

Initializes a new instance of the Number struct.

public Number(int value)

Parameters

value int

The value of the number.

Number(uint)

Initializes a new instance of the Number struct.

public Number(uint value)

Parameters

value uint

The value of the number.

Methods

CompareTo(Number)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

public int CompareTo(Number other)

Parameters

other Number

An object to compare with this instance.

Returns

int

A value that indicates the relative order of the objects being compared. The return value has these meanings:

Value Meaning
Less than zero This instance precedes other in the sort order.
Zero This instance occurs in the same position in the sort order as other.
Greater than zero This instance follows other in the sort order.

Equals(Number)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(Number other)

Parameters

other Number

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

ToString(IFormatProvider)

Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information.

public string ToString(IFormatProvider provider)

Parameters

provider IFormatProvider

An object that supplies culture-specific formatting information.

Returns

string

The string representation of the value of this instance, which consists of a sequence of digits ranging from 0 to 9, without a sign or leading zeros.

Operators

operator ==(Number, Number)

Determines whether the specified Number instances are considered equal.

public static bool operator ==(Number left, Number right)

Parameters

left Number

The first Number to compare.

right Number

The second Number to compare.

Returns

bool

explicit operator int(Number)

Converts the specified Number to a int.

public static explicit operator int(Number number)

Parameters

number Number

The Number to convert.

Returns

int

explicit operator ushort(Number)

Converts the specified Number to a ushort.

public static explicit operator ushort(Number number)

Parameters

number Number

The Number to convert.

Returns

ushort

explicit operator uint(Number)

Converts the specified Number to a uint.

public static explicit operator uint(Number number)

Parameters

number Number

The Number to convert.

Returns

uint

operator >(Number, Number)

Determines whether the first Number is more than the second Number.

public static bool operator >(Number left, Number right)

Parameters

left Number

The first Number to compare.

right Number

The second Number to compare.

Returns

bool

operator >=(Number, Number)

Determines whether the first Number is more than or equal to the second Number.

public static bool operator >=(Number left, Number right)

Parameters

left Number

The first Number to compare.

right Number

The second Number to compare.

Returns

bool

implicit operator Number(int)

Converts the specified int to an instance of this type.

public static implicit operator Number(int value)

Parameters

value int

The value.

Returns

Number

implicit operator Number(ushort)

Converts the specified ushort to an instance of this type.

public static implicit operator Number(ushort value)

Parameters

value ushort

The value.

Returns

Number

implicit operator Number(uint)

Converts the specified uint to an instance of this type.

public static implicit operator Number(uint value)

Parameters

value uint

The value.

Returns

Number

operator !=(Number, Number)

Determines whether the specified Number instances are not considered equal.

public static bool operator !=(Number left, Number right)

Parameters

left Number

The first Number to compare.

right Number

The second Number to compare.

Returns

bool

operator <(Number, Number)

Determines whether the first Number is less than the second Number.

public static bool operator <(Number left, Number right)

Parameters

left Number

The first Number to compare.

right Number

The second Number to compare.

Returns

bool

operator <=(Number, Number)

Determines whether the first Number is less than or equal to the second Number.

public static bool operator <=(Number left, Number right)

Parameters

left Number

The first Number to compare.

right Number

The second Number to compare.

Returns

bool