Table of Contents

Struct ExInt128

Namespace
Zyl.VectorTraits.ExTypes
Assembly
VectorTraits.dll

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

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

Constructors

ExInt128(ulong, ulong)

Initializes a new instance of the ExInt128 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.

NegativeOne

Gets the value -1 for the type.

One

Gets the value 1 for the type.

Upper

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

Zero

Gets the value 0 for the type.

Methods

Abs(ExInt128)

Computes the absolute of a value.

Clamp(ExInt128, ExInt128, ExInt128)

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(ExInt128)

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.

CopySign(ExInt128, ExInt128)

Copies the sign of a value to the sign of another value.

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(ExInt128, ExInt128)

Computes the quotient and remainder of two values.

Equals(object?)

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

Equals(ExInt128)

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(ExInt128)

Determines if a value represents an even integral number.

IsNegative(ExInt128)

Determines if a value represents a negative real number.

IsOddInteger(ExInt128)

Determines if a value represents an odd integral number.

IsPositive(ExInt128)

Determines if a value represents zero or a positive real number.

IsPow2(ExInt128)

Determines if a value is a power of two.

LeadingZeroCount(ExInt128)

Computes the number of leading zero bits in a value.

Log2(ExInt128)

Computes the log2 of a value.

Max(ExInt128, ExInt128)

Compares two values to compute which is greater.

MaxMagnitude(ExInt128, ExInt128)

Compares two values to compute which is greater.

Min(ExInt128, ExInt128)

Compares two values to compute which is lesser.

MinMagnitude(ExInt128, ExInt128)

Compares two values to compute which is lesser.

MultiplyAddEstimate(ExInt128, ExInt128, ExInt128)
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(ExInt128)

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

RotateLeft(ExInt128, int)

Rotates a value left by a given amount.

RotateRight(ExInt128, int)

Rotates a value right by a given amount.

Sign(ExInt128)

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(ExInt128)

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 ExInt128)

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

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

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

TryParse(ReadOnlySpan<byte>, out ExInt128)

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

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

Tries to parse a span of characters into a value.

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

Tries to parse a span of characters into a value.

TryParse(ReadOnlySpan<char>, out ExInt128)

Tries to parse a span of characters into a value.

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

Tries to parse a string into a value.

TryParse(string?, IFormatProvider?, out ExInt128)

Tries to parse a string into a value.

TryParse(string?, out ExInt128)

Tries to parse a string into a value.

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

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 ExInt128)

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 +(ExInt128, ExInt128)

Adds two values together to compute their sum.

operator &(ExInt128, ExInt128)

Computes the bitwise-and of two values.

operator |(ExInt128, ExInt128)

Computes the bitwise-or of two values.

operator checked +(ExInt128, ExInt128)

Adds two values together to compute their sum.

operator checked --(ExInt128)

Decrements a value.

operator checked /(ExInt128, ExInt128)

Divides two values together to compute their quotient.

explicit operator checked ExInt128(double)

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

explicit operator checked ExInt128(Half)

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

explicit operator checked ExInt128(float)

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

explicit operator checked byte(ExInt128)

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

explicit operator checked char(ExInt128)

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

explicit operator checked short(ExInt128)

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

explicit operator checked int(ExInt128)

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

explicit operator checked long(ExInt128)

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

explicit operator checked nint(ExInt128)

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

explicit operator checked sbyte(ExInt128)

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

explicit operator checked ushort(ExInt128)

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

explicit operator checked uint(ExInt128)

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

explicit operator checked ulong(ExInt128)

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

explicit operator checked nuint(ExInt128)

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

explicit operator checked ExUInt128(ExInt128)

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

operator checked ++(ExInt128)

Increments a value.

operator checked *(ExInt128, ExInt128)

Multiplies two values together to compute their product.

operator checked -(ExInt128, ExInt128)

Subtracts two values to compute their difference.

operator checked -(ExInt128)

Computes the checked unary negation of a value.

operator --(ExInt128)

Decrements a value.

operator /(ExInt128, ExInt128)

Divides one value by another to compute their quotient.

operator ==(ExInt128, ExInt128)

Compares two values to determine equality.

operator ^(ExInt128, ExInt128)

Computes the exclusive-or of two values.

explicit operator ExInt128(decimal)

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

explicit operator ExInt128(double)

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

explicit operator ExInt128(Half)

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

explicit operator ExInt128(float)

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

explicit operator byte(ExInt128)

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

explicit operator char(ExInt128)

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

explicit operator decimal(ExInt128)

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

explicit operator double(ExInt128)

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

explicit operator Half(ExInt128)

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

explicit operator short(ExInt128)

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

explicit operator int(ExInt128)

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

explicit operator long(ExInt128)

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

explicit operator nint(ExInt128)

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

explicit operator sbyte(ExInt128)

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

explicit operator float(ExInt128)

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

explicit operator ushort(ExInt128)

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

explicit operator uint(ExInt128)

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

explicit operator ulong(ExInt128)

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

explicit operator nuint(ExInt128)

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

explicit operator ExUInt128(ExInt128)

Explicitly converts a 128-bit signed integer to a ExUInt128 value.

operator >(ExInt128, ExInt128)

Compares two values to determine which is greater.

operator >=(ExInt128, ExInt128)

Compares two values to determine which is greater or equal.

implicit operator ExInt128(byte)

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

implicit operator ExInt128(char)

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

implicit operator ExInt128(Int128)

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

implicit operator ExInt128(short)

Implicitly converts a short value to a 128-bit signed integer.

implicit operator ExInt128(int)

Implicitly converts a int value to a 128-bit signed integer.

implicit operator ExInt128(long)

Implicitly converts a long value to a 128-bit signed integer.

implicit operator ExInt128(nint)

Implicitly converts a nint value to a 128-bit signed integer.

implicit operator ExInt128(sbyte)

Implicitly converts a sbyte value to a 128-bit signed integer.

implicit operator ExInt128(UInt128)

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

implicit operator ExInt128(ushort)

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

implicit operator ExInt128(uint)

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

implicit operator ExInt128(ulong)

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

implicit operator ExInt128(nuint)

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

implicit operator Int128(ExInt128)

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

implicit operator UInt128(ExInt128)

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

operator ++(ExInt128)

Increments a value.

operator !=(ExInt128, ExInt128)

Compares two values to determine inequality.

operator <<(ExInt128, int)

Shifts a value left by a given amount.

operator <(ExInt128, ExInt128)

Compares two values to determine which is less.

operator <=(ExInt128, ExInt128)

Compares two values to determine which is less or equal.

operator %(ExInt128, ExInt128)

Divides two values together to compute their modulus or remainder.

operator *(ExInt128, ExInt128)

Multiplies two values together to compute their product.

operator ~(ExInt128)

Computes the ones-complement representation of a given value.

operator >>(ExInt128, int)

Shifts a value right by a given amount.

operator -(ExInt128, ExInt128)

Subtracts two values to compute their difference.

operator -(ExInt128)

Computes the unary negation of a value.

operator +(ExInt128)

Computes the unary plus of a value.

operator >>>(ExInt128, int)

Shifts a value right by a given amount.