Table of Contents

Struct ExUInt128

Namespace
Zyl.VectorTraits.ExTypes
Assembly
VectorTraits.dll

Represents a 128-bit unsigned integer. It is binary compatible with UInt128 (表示 128 位无符号整数. 它与 UInt128 是二进制兼容的).

[CLSCompliant(false)]
public readonly struct ExUInt128 : IBinaryInteger<ExUInt128>, IBinaryNumber<ExUInt128>, IBitwiseOperators<ExUInt128, ExUInt128, ExUInt128>, INumber<ExUInt128>, IComparable, IComparable<ExUInt128>, IComparisonOperators<ExUInt128, ExUInt128, bool>, IModulusOperators<ExUInt128, ExUInt128, ExUInt128>, IShiftOperators<ExUInt128, int, ExUInt128>, IMinMaxValue<ExUInt128>, IUnsignedNumber<ExUInt128>, INumberBase<ExUInt128>, IEquatable<ExUInt128>, ISpanFormattable, IFormattable, ISpanParsable<ExUInt128>, IParsable<ExUInt128>, IAdditionOperators<ExUInt128, ExUInt128, ExUInt128>, IAdditiveIdentity<ExUInt128, ExUInt128>, IDecrementOperators<ExUInt128>, IDivisionOperators<ExUInt128, ExUInt128, ExUInt128>, IEqualityOperators<ExUInt128, ExUInt128, bool>, IIncrementOperators<ExUInt128>, IMultiplicativeIdentity<ExUInt128, ExUInt128>, IMultiplyOperators<ExUInt128, ExUInt128, ExUInt128>, ISubtractionOperators<ExUInt128, ExUInt128, ExUInt128>, IUnaryNegationOperators<ExUInt128, ExUInt128>, IUnaryPlusOperators<ExUInt128, ExUInt128>, IUtf8SpanFormattable, IUtf8SpanParsable<ExUInt128>
Implements
Inherited Members

Constructors

ExUInt128(ulong, ulong)

Initializes a new instance of the ExUInt128 struct.

Properties

AllBitsSet

Gets an instance of the binary type in which all bits are set.

Lower

Get the lower half (取得低半部分).

MaxValue

Gets the maximum value of the current type.

MinValue

Gets the minimum value of the current type.

One

Gets the value 1 for the type.

Upper

Get the upper half (取得高半部分).

Zero

Gets the value 0 for the type.

Methods

Clamp(ExUInt128, ExUInt128, ExUInt128)

Clamps a value to an inclusive minimum and maximum value.

CompareTo(object?)

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.

CompareTo(ExUInt128)

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.

CreateChecked<TOther>(TOther)

Creates an instance of the current type from a value, throwing an overflow exception for any values that fall outside the representable range of the current type.

CreateSaturating<TOther>(TOther)

Creates an instance of the current type from a value, saturating any values that fall outside the representable range of the current type.

CreateTruncating<TOther>(TOther)

Creates an instance of the current type from a value, truncating any values that fall outside the representable range of the current type.

DivRem(ExUInt128, ExUInt128)

Computes the quotient and remainder of two values.

Equals(object?)

Determines whether the specified object is equal to the current object.

Equals(ExUInt128)

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

GetByteCount()

Gets the number of bytes that will be written as part of TryWriteLittleEndian(Span<byte>, out int).

GetHashCode()

Serves as the default hash function.

GetShortestBitLength()

Gets the length, in bits, of the shortest two's complement representation of the current value.

IsEvenInteger(ExUInt128)

Determines if a value represents an even integral number.

IsOddInteger(ExUInt128)

Determines if a value represents an odd integral number.

IsPow2(ExUInt128)

Determines if a value is a power of two.

LeadingZeroCount(ExUInt128)

Computes the number of leading zero bits in a value.

Log2(ExUInt128)

Computes the log2 of a value.

Max(ExUInt128, ExUInt128)

Compares two values to compute which is greater.

Min(ExUInt128, ExUInt128)

Compares two values to compute which is lesser.

MultiplyAddEstimate(ExUInt128, ExUInt128, ExUInt128)
Parse(ReadOnlySpan<byte>, NumberStyles, IFormatProvider?)

Parses a span of UTF-8 characters into a value.

Parse(ReadOnlySpan<byte>, IFormatProvider?)

Parses a span of UTF-8 characters into a value.

Parse(ReadOnlySpan<char>, NumberStyles, IFormatProvider?)

Parses a span of characters into a value.

Parse(ReadOnlySpan<char>, IFormatProvider?)

Parses a span of characters into a value.

Parse(string)

Parses a string into a value.

Parse(string, NumberStyles)

Parses a string into a value.

Parse(string, NumberStyles, IFormatProvider?)

Parses a string into a value.

Parse(string, IFormatProvider?)

Parses a string into a value.

PopCount(ExUInt128)

Computes the number of bits that are set in a value.

RotateLeft(ExUInt128, int)

Rotates a value left by a given amount.

RotateRight(ExUInt128, int)

Rotates a value right by a given amount.

Sign(ExUInt128)

Computes the sign of a value.

ToString()

Returns a string that represents the current object.

ToString(IFormatProvider?)

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

ToString(string?)

Converts the numeric value of this instance to its equivalent string representation, using the specified format.

ToString(string?, IFormatProvider?)

Formats the value of the current instance using the specified format.

TrailingZeroCount(ExUInt128)

Computes the number of trailing zero bits in a value.

TryFormat(Span<byte>, out int, ReadOnlySpan<char>, IFormatProvider?)

Tries to format the value of the current instance as UTF-8 into the provided span of bytes.

TryFormat(Span<char>, out int, ReadOnlySpan<char>, IFormatProvider?)

Tries to format the value of the current instance into the provided span of characters.

TryParse(ReadOnlySpan<byte>, NumberStyles, IFormatProvider?, out ExUInt128)

Tries to parse a span of UTF-8 characters into a value.

TryParse(ReadOnlySpan<byte>, IFormatProvider?, out ExUInt128)

Tries to parse a span of UTF-8 characters into a value.

TryParse(ReadOnlySpan<byte>, out ExUInt128)

Tries to convert a UTF-8 character span containing the string representation of a number to its 128-bit unsigned integer equivalent.

TryParse(ReadOnlySpan<char>, NumberStyles, IFormatProvider?, out ExUInt128)

Tries to parse a span of characters into a value.

TryParse(ReadOnlySpan<char>, IFormatProvider?, out ExUInt128)

Tries to parse a span of characters into a value.

TryParse(ReadOnlySpan<char>, out ExUInt128)

Tries to parse a span of characters into a value.

TryParse(string?, NumberStyles, IFormatProvider?, out ExUInt128)

Tries to parse a string into a value.

TryParse(string?, IFormatProvider?, out ExUInt128)

Tries to parse a string into a value.

TryParse(string?, out ExUInt128)

Tries to parse a string into a value.

TryReadBigEndian(ReadOnlySpan<byte>, bool, out ExUInt128)

Tries to read a two's complement number from a span, in big-endian format, and convert it to an instance of the current type.

TryReadLittleEndian(ReadOnlySpan<byte>, bool, out ExUInt128)

Tries to read a two's complement number from a span, in little-endian format, and convert it to an instance of the current type.

TryWriteBigEndian(Span<byte>, out int)

Tries to write the current value, in big-endian format, to a given span.

TryWriteLittleEndian(Span<byte>, out int)

Tries to write the current value, in little-endian format, to a given span.

Operators

operator +(ExUInt128, ExUInt128)

Adds two values together to compute their sum.

operator &(ExUInt128, ExUInt128)

Computes the bitwise-and of two values.

operator |(ExUInt128, ExUInt128)

Computes the bitwise-or of two values.

operator checked +(ExUInt128, ExUInt128)

Adds two values together to compute their sum.

operator checked --(ExUInt128)

Decrements a value.

operator checked /(ExUInt128, ExUInt128)

Divides two values together to compute their quotient.

explicit operator checked ExUInt128(double)

Explicitly converts a double value to a 128-bit unsigned integer, throwing an overflow exception for any values that fall outside the representable range.

explicit operator checked ExUInt128(Half)

Explicitly converts a Half value to a 128-bit unsigned integer, throwing an overflow exception for any values that fall outside the representable range.

explicit operator checked ExUInt128(short)

Explicitly converts a short value to a 128-bit unsigned integer, throwing an overflow exception for any values that fall outside the representable range.

explicit operator checked ExUInt128(int)

Explicitly converts a int value to a 128-bit unsigned integer, throwing an overflow exception for any values that fall outside the representable range.

explicit operator checked ExUInt128(long)

Explicitly converts a long value to a 128-bit unsigned integer, throwing an overflow exception for any values that fall outside the representable range.

explicit operator checked ExUInt128(nint)

Explicitly converts a nint value to a 128-bit unsigned integer, throwing an overflow exception for any values that fall outside the representable range.

explicit operator checked ExUInt128(sbyte)

Explicitly converts a sbyte value to a 128-bit unsigned integer, throwing an overflow exception for any values that fall outside the representable range.

explicit operator checked ExUInt128(float)

Explicitly converts a float value to a 128-bit unsigned integer, throwing an overflow exception for any values that fall outside the representable range.

explicit operator checked byte(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a byte value, throwing an overflow exception for any values that fall outside the representable range.

explicit operator checked char(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a char value, throwing an overflow exception for any values that fall outside the representable range.

explicit operator checked short(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a short value, throwing an overflow exception for any values that fall outside the representable range.

explicit operator checked int(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a int value, throwing an overflow exception for any values that fall outside the representable range.

explicit operator checked long(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a long value, throwing an overflow exception for any values that fall outside the representable range.

explicit operator checked nint(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a nint value, throwing an overflow exception for any values that fall outside the representable range.

explicit operator checked sbyte(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a sbyte value, throwing an overflow exception for any values that fall outside the representable range.

explicit operator checked ushort(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a ushort value, throwing an overflow exception for any values that fall outside the representable range.

explicit operator checked uint(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a uint value, throwing an overflow exception for any values that fall outside the representable range.

explicit operator checked ulong(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a ulong value, throwing an overflow exception for any values that fall outside the representable range.

explicit operator checked nuint(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a nuint value, throwing an overflow exception for any values that fall outside the representable range.

explicit operator checked ExInt128(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a ExInt128 value, throwing an overflow exception for any values that fall outside the representable range.

operator checked ++(ExUInt128)

Increments a value.

operator checked *(ExUInt128, ExUInt128)

Multiplies two values together to compute their product.

operator checked -(ExUInt128, ExUInt128)

Subtracts two values to compute their difference.

operator checked -(ExUInt128)

Computes the checked unary negation of a value.

operator --(ExUInt128)

Decrements a value.

operator /(ExUInt128, ExUInt128)

Divides one value by another to compute their quotient.

operator ==(ExUInt128, ExUInt128)

Compares two values to determine equality.

operator ^(ExUInt128, ExUInt128)

Computes the exclusive-or of two values.

explicit operator ExUInt128(decimal)

Explicitly converts a decimal value to a 128-bit unsigned integer.

explicit operator ExUInt128(double)

Explicitly converts a double value to a 128-bit unsigned integer.

explicit operator ExUInt128(Half)

Explicitly converts a Half value to a 128-bit unsigned integer.

explicit operator ExUInt128(Int128)

Implicit converts a Int128 value to a 128-bit unsigned integer.

explicit operator ExUInt128(short)

Explicitly converts a short value to a 128-bit unsigned integer.

explicit operator ExUInt128(int)

Explicitly converts a int value to a 128-bit unsigned integer.

explicit operator ExUInt128(long)

Explicitly converts a long value to a 128-bit unsigned integer.

explicit operator ExUInt128(nint)

Explicitly converts a nint value to a 128-bit unsigned integer.

explicit operator ExUInt128(sbyte)

Explicitly converts a sbyte value to a 128-bit unsigned integer.

explicit operator ExUInt128(float)

Explicitly converts a float value to a 128-bit unsigned integer.

explicit operator byte(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a byte value.

explicit operator char(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a char value.

explicit operator decimal(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a decimal value.

explicit operator double(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a double value.

explicit operator Half(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a Half value.

explicit operator Int128(ExUInt128)

Implicit converts a 128-bit unsigned integer to a Int128 value.

explicit operator short(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a short value.

explicit operator int(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a int value.

explicit operator long(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a long value.

explicit operator nint(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a nint value.

explicit operator sbyte(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a sbyte value.

explicit operator float(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a float value.

explicit operator ushort(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a ushort value.

explicit operator uint(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a uint value.

explicit operator ulong(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a ulong value.

explicit operator nuint(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a nuint value.

explicit operator ExInt128(ExUInt128)

Explicitly converts a 128-bit unsigned integer to a ExInt128 value.

operator >(ExUInt128, ExUInt128)

Compares two values to determine which is greater.

operator >=(ExUInt128, ExUInt128)

Compares two values to determine which is greater or equal.

implicit operator ExUInt128(byte)

Implicitly converts a byte value to a 128-bit unsigned integer.

implicit operator ExUInt128(char)

Implicitly converts a char value to a 128-bit unsigned integer.

implicit operator ExUInt128(UInt128)

Implicit converts a UInt128 value to a 128-bit unsigned integer.

implicit operator ExUInt128(ushort)

Implicitly converts a ushort value to a 128-bit unsigned integer.

implicit operator ExUInt128(uint)

Implicitly converts a uint value to a 128-bit unsigned integer.

implicit operator ExUInt128(ulong)

Implicitly converts a ulong value to a 128-bit unsigned integer.

implicit operator ExUInt128(nuint)

Implicitly converts a nuint value to a 128-bit unsigned integer.

implicit operator UInt128(ExUInt128)

Implicit converts a 128-bit unsigned integer to a UInt128 value.

operator ++(ExUInt128)

Increments a value.

operator !=(ExUInt128, ExUInt128)

Compares two values to determine inequality.

operator <<(ExUInt128, int)

Shifts a value left by a given amount.

operator <(ExUInt128, ExUInt128)

Compares two values to determine which is less.

operator <=(ExUInt128, ExUInt128)

Compares two values to determine which is less or equal.

operator %(ExUInt128, ExUInt128)

Divides two values together to compute their modulus or remainder.

operator *(ExUInt128, ExUInt128)

Multiplies two values together to compute their product.

operator ~(ExUInt128)

Computes the ones-complement representation of a given value.

operator >>(ExUInt128, int)

Shifts a value right by a given amount.

operator -(ExUInt128, ExUInt128)

Subtracts two values to compute their difference.

operator -(ExUInt128)

Computes the unary negation of a value.

operator +(ExUInt128)

Computes the unary plus of a value.

operator >>>(ExUInt128, int)

Shifts a value right by a given amount.