Struct Number
Represents an integral number.
Inherited Members
Namespace: SixLabors.ImageSharp
Assembly: SixLabors.ImageSharp.dll
Syntax
public struct Number : IEquatable<Number>, IComparable<Number>
Constructors
| Edit this page View SourceNumber(int)
Initializes a new instance of the Number struct.
Declaration
public Number(int value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | value | The value of the number. |
Number(uint)
Initializes a new instance of the Number struct.
Declaration
public Number(uint value)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | value | The value of the number. |
Methods
| Edit this page View SourceCompareTo(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.
Declaration
public int CompareTo(Number other)
Parameters
| Type | Name | Description |
|---|---|---|
| Number | other | An object to compare with this instance. |
Returns
| Type | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| int | A value that indicates the relative order of the objects being compared. The return value has these meanings:
|
Equals(Number)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(Number other)
Parameters
| Type | Name | Description |
|---|---|---|
| Number | other | An object to compare with this object. |
Returns
| Type | Description |
|---|---|
| bool | true if the current object is equal to the |
Equals(object?)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with the current instance. |
Returns
| Type | Description |
|---|---|
| bool | true if |
Overrides
| Edit this page View SourceGetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A 32-bit signed integer that is the hash code for this instance. |
Overrides
| Edit this page View SourceToString()
Returns the fully qualified type name of this instance.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | The fully qualified type name. |
Overrides
| Edit this page View SourceToString(IFormatProvider)
Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information.
Declaration
public string ToString(IFormatProvider provider)
Parameters
| Type | Name | Description |
|---|---|---|
| IFormatProvider | provider | An object that supplies culture-specific formatting information. |
Returns
| Type | Description |
|---|---|
| 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
| Edit this page View Sourceoperator ==(Number, Number)
Determines whether the specified Number instances are considered equal.
Declaration
public static bool operator ==(Number left, Number right)
Parameters
| Type | Name | Description |
|---|---|---|
| Number | left | The first Number to compare. |
| Number | right | The second Number to compare. |
Returns
| Type | Description |
|---|---|
| bool |
explicit operator int(Number)
Declaration
public static explicit operator int(Number number)
Parameters
| Type | Name | Description |
|---|---|---|
| Number | number | The Number to convert. |
Returns
| Type | Description |
|---|---|
| int |
explicit operator ushort(Number)
Declaration
public static explicit operator ushort(Number number)
Parameters
| Type | Name | Description |
|---|---|---|
| Number | number | The Number to convert. |
Returns
| Type | Description |
|---|---|
| ushort |
explicit operator uint(Number)
Declaration
public static explicit operator uint(Number number)
Parameters
| Type | Name | Description |
|---|---|---|
| Number | number | The Number to convert. |
Returns
| Type | Description |
|---|---|
| uint |
operator >(Number, Number)
Declaration
public static bool operator >(Number left, Number right)
Parameters
| Type | Name | Description |
|---|---|---|
| Number | left | The first Number to compare. |
| Number | right | The second Number to compare. |
Returns
| Type | Description |
|---|---|
| bool |
operator >=(Number, Number)
Declaration
public static bool operator >=(Number left, Number right)
Parameters
| Type | Name | Description |
|---|---|---|
| Number | left | The first Number to compare. |
| Number | right | The second Number to compare. |
Returns
| Type | Description |
|---|---|
| bool |
implicit operator Number(int)
Converts the specified int to an instance of this type.
Declaration
public static implicit operator Number(int value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | value | The value. |
Returns
| Type | Description |
|---|---|
| Number |
implicit operator Number(ushort)
Converts the specified ushort to an instance of this type.
Declaration
public static implicit operator Number(ushort value)
Parameters
| Type | Name | Description |
|---|---|---|
| ushort | value | The value. |
Returns
| Type | Description |
|---|---|
| Number |
implicit operator Number(uint)
Converts the specified uint to an instance of this type.
Declaration
public static implicit operator Number(uint value)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | value | The value. |
Returns
| Type | Description |
|---|---|
| Number |
operator !=(Number, Number)
Determines whether the specified Number instances are not considered equal.
Declaration
public static bool operator !=(Number left, Number right)
Parameters
| Type | Name | Description |
|---|---|---|
| Number | left | The first Number to compare. |
| Number | right | The second Number to compare. |
Returns
| Type | Description |
|---|---|
| bool |
operator <(Number, Number)
Declaration
public static bool operator <(Number left, Number right)
Parameters
| Type | Name | Description |
|---|---|---|
| Number | left | The first Number to compare. |
| Number | right | The second Number to compare. |
Returns
| Type | Description |
|---|---|
| bool |
operator <=(Number, Number)
Declaration
public static bool operator <=(Number left, Number right)
Parameters
| Type | Name | Description |
|---|---|---|
| Number | left | The first Number to compare. |
| Number | right | The second Number to compare. |
Returns
| Type | Description |
|---|---|
| bool |