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
valueintThe value of the number.
Number(uint)
Initializes a new instance of the Number struct.
public Number(uint value)
Parameters
valueuintThe 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
otherNumberAn 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 otherin the sort order.Zero This instance occurs in the same position in the sort order as other.Greater than zero This instance follows otherin 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
otherNumberAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand 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
providerIFormatProviderAn 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
Returns
explicit operator int(Number)
public static explicit operator int(Number number)
Parameters
Returns
explicit operator ushort(Number)
public static explicit operator ushort(Number number)
Parameters
Returns
explicit operator uint(Number)
public static explicit operator uint(Number number)
Parameters
Returns
operator >(Number, Number)
public static bool operator >(Number left, Number right)
Parameters
Returns
operator >=(Number, Number)
public static bool operator >=(Number left, Number right)
Parameters
Returns
implicit operator Number(int)
Converts the specified int to an instance of this type.
public static implicit operator Number(int value)
Parameters
valueintThe value.
Returns
implicit operator Number(ushort)
Converts the specified ushort to an instance of this type.
public static implicit operator Number(ushort value)
Parameters
valueushortThe value.
Returns
implicit operator Number(uint)
Converts the specified uint to an instance of this type.
public static implicit operator Number(uint value)
Parameters
valueuintThe value.
Returns
operator !=(Number, Number)
Determines whether the specified Number instances are not considered equal.
public static bool operator !=(Number left, Number right)
Parameters
Returns
operator <(Number, Number)
public static bool operator <(Number left, Number right)
Parameters
Returns
operator <=(Number, Number)
public static bool operator <=(Number left, Number right)