11[TypeForwardedFrom(
"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
12public readonly
struct SByte :
IComparable,
IConvertible,
ISpanFormattable,
IFormattable,
IComparable<sbyte>,
IEquatable<sbyte>,
IBinaryInteger<sbyte>,
IBinaryNumber<sbyte>,
IBitwiseOperators<sbyte, sbyte, sbyte>,
INumber<sbyte>,
IAdditionOperators<sbyte, sbyte, sbyte>,
IAdditiveIdentity<sbyte, sbyte>,
IComparisonOperators<sbyte, sbyte>,
IEqualityOperators<sbyte, sbyte>,
IDecrementOperators<sbyte>,
IDivisionOperators<sbyte, sbyte, sbyte>,
IIncrementOperators<sbyte>,
IModulusOperators<sbyte, sbyte, sbyte>,
IMultiplicativeIdentity<sbyte, sbyte>,
IMultiplyOperators<sbyte, sbyte, sbyte>,
ISpanParseable<sbyte>,
IParseable<sbyte>,
ISubtractionOperators<sbyte, sbyte, sbyte>,
IUnaryNegationOperators<sbyte, sbyte>,
IUnaryPlusOperators<sbyte, sbyte>,
IShiftOperators<sbyte, sbyte>,
IMinMaxValue<sbyte>,
ISignedNumber<sbyte>
20 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
23 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
26 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
29 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
32 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
35 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
38 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
51 return this - (sbyte)
obj;
59 public override bool Equals([NotNullWhen(
true)]
object?
obj)
65 return this == (sbyte)
obj;
152 if (parsingStatus != 0)
156 if ((uint)(result - -128 - ((
int)(style &
NumberStyles.AllowHexSpecifier) >> 2)) > 255u)
160 return (sbyte)result;
163 public static bool TryParse([NotNullWhen(
true)]
string?
s, out sbyte result)
202 result = (sbyte)result2;
286 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
289 return (sbyte)(left + right);
292 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
298 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
304 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
307 return (sbyte)((
value << (rotateAmount & 7)) | ((byte)
value >> ((8 - rotateAmount) & 7)));
310 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
313 return (sbyte)(((byte)
value >> (rotateAmount & 7)) | (
value << ((8 - rotateAmount) & 7)));
316 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
322 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
328 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
338 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
341 return (sbyte)(left & right);
344 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
347 return (sbyte)(left | right);
350 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
353 return (sbyte)(left ^ right);
356 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
359 return (sbyte)(~value);
362 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
368 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
371 return left <= right;
374 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
380 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
383 return left >= right;
386 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
392 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
395 return (sbyte)(left / right);
398 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
401 return left == right;
404 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
407 return left != right;
410 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
416 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
419 return (sbyte)(left % right);
422 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
425 return (sbyte)(left * right);
428 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
434 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
441 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
446 if (typeof(TOther) == typeof(
byte))
448 return (sbyte)(byte)(
object)
value;
450 if (typeof(TOther) == typeof(
char))
452 return (sbyte)(char)(
object)
value;
454 if (typeof(TOther) == typeof(decimal))
456 return (sbyte)(decimal)(
object)
value;
458 if (typeof(TOther) == typeof(
double))
460 return (sbyte)(double)(
object)
value;
462 if (typeof(TOther) == typeof(
short))
466 if (typeof(TOther) == typeof(
int))
468 return (sbyte)(int)(
object)
value;
470 if (typeof(TOther) == typeof(
long))
472 return (sbyte)(long)(
object)
value;
474 if (typeof(TOther) == typeof(
IntPtr))
478 if (typeof(TOther) == typeof(sbyte))
480 return (sbyte)(object)
value;
482 if (typeof(TOther) == typeof(
float))
484 return (sbyte)(float)(
object)
value;
486 if (typeof(TOther) == typeof(ushort))
488 return (sbyte)(ushort)(
object)
value;
490 if (typeof(TOther) == typeof(uint))
492 return (sbyte)(uint)(
object)
value;
494 if (typeof(TOther) == typeof(ulong))
496 return (sbyte)(ulong)(
object)
value;
498 if (typeof(TOther) == typeof(
UIntPtr))
508 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
511 if (typeof(TOther) == typeof(
byte))
513 byte b = (byte)(
object)
value;
518 return sbyte.MaxValue;
520 if (typeof(TOther) == typeof(
char))
522 char c = (char)(
object)
value;
527 return sbyte.MaxValue;
529 if (typeof(TOther) == typeof(decimal))
531 decimal num = (decimal)(
object)
value;
538 return sbyte.MinValue;
540 return sbyte.MaxValue;
542 if (typeof(TOther) == typeof(
double))
544 double num2 = (double)(
object)
value;
547 if (!(num2 < -128.0))
551 return sbyte.MinValue;
553 return sbyte.MaxValue;
555 if (typeof(TOther) == typeof(
short))
564 return sbyte.MinValue;
566 return sbyte.MaxValue;
568 if (typeof(TOther) == typeof(
int))
570 int num4 = (int)(
object)
value;
577 return sbyte.MinValue;
579 return sbyte.MaxValue;
581 if (typeof(TOther) == typeof(
long))
583 long num5 = (long)(
object)
value;
590 return sbyte.MinValue;
592 return sbyte.MaxValue;
594 if (typeof(TOther) == typeof(
IntPtr))
597 if ((nint)intPtr <= 127)
599 if ((nint)intPtr >= -128)
601 return (sbyte)(nint)intPtr;
605 return sbyte.MaxValue;
607 if (typeof(TOther) == typeof(sbyte))
609 return (sbyte)(object)
value;
611 if (typeof(TOther) == typeof(
float))
613 float num6 = (float)(
object)
value;
620 return sbyte.MinValue;
622 return sbyte.MaxValue;
624 if (typeof(TOther) == typeof(ushort))
626 ushort num7 = (ushort)(
object)
value;
631 return sbyte.MaxValue;
633 if (typeof(TOther) == typeof(uint))
635 uint num8 = (uint)(
object)
value;
636 if ((
long)num8 <= 127
L)
640 return sbyte.MaxValue;
642 if (typeof(TOther) == typeof(ulong))
644 ulong num9 = (ulong)(
object)
value;
649 return sbyte.MaxValue;
651 if (typeof(TOther) == typeof(
UIntPtr))
654 if ((nuint)uIntPtr <= 127)
656 return (sbyte)(nuint)uIntPtr;
665 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
668 if (typeof(TOther) == typeof(
byte))
670 return (sbyte)(byte)(
object)
value;
672 if (typeof(TOther) == typeof(
char))
674 return (sbyte)(char)(
object)
value;
676 if (typeof(TOther) == typeof(decimal))
678 return (sbyte)(decimal)(
object)
value;
680 if (typeof(TOther) == typeof(
double))
682 return (sbyte)(double)(
object)
value;
684 if (typeof(TOther) == typeof(
short))
688 if (typeof(TOther) == typeof(
int))
690 return (sbyte)(int)(
object)
value;
692 if (typeof(TOther) == typeof(
long))
694 return (sbyte)(long)(
object)
value;
696 if (typeof(TOther) == typeof(
IntPtr))
700 if (typeof(TOther) == typeof(sbyte))
702 return (sbyte)(object)
value;
704 if (typeof(TOther) == typeof(
float))
706 return (sbyte)(float)(
object)
value;
708 if (typeof(TOther) == typeof(ushort))
710 return (sbyte)(ushort)(
object)
value;
712 if (typeof(TOther) == typeof(uint))
714 return (sbyte)(uint)(
object)
value;
716 if (typeof(TOther) == typeof(ulong))
718 return (sbyte)(ulong)(
object)
value;
720 if (typeof(TOther) == typeof(
UIntPtr))
728 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
734 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
740 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
746 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
749 return Parse(
s, style, provider);
752 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
755 return Parse(
s, style, provider);
758 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
765 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
768 if (typeof(TOther) == typeof(
byte))
770 byte b = (byte)(
object)
value;
779 if (typeof(TOther) == typeof(
char))
781 char c = (char)(
object)
value;
790 if (typeof(TOther) == typeof(decimal))
792 decimal num = (decimal)(
object)
value;
793 if (num < -128m || num > 127m)
801 if (typeof(TOther) == typeof(
double))
803 double num2 = (double)(
object)
value;
804 if (num2 < -128.0 || num2 > 127.0)
809 result = (sbyte)num2;
812 if (typeof(TOther) == typeof(
short))
815 if (num3 < -128 || num3 > 127)
820 result = (sbyte)num3;
823 if (typeof(TOther) == typeof(
int))
825 int num4 = (int)(
object)
value;
826 if (num4 < -128 || num4 > 127)
831 result = (sbyte)num4;
834 if (typeof(TOther) == typeof(
long))
836 long num5 = (long)(
object)
value;
837 if (num5 < -128 || num5 > 127)
842 result = (sbyte)num5;
845 if (typeof(TOther) == typeof(
IntPtr))
848 if ((nint)intPtr < -128 || (nint)intPtr > 127)
853 result = (sbyte)(nint)intPtr;
856 if (typeof(TOther) == typeof(sbyte))
858 result = (sbyte)(
object)
value;
861 if (typeof(TOther) == typeof(
float))
863 float num6 = (float)(
object)
value;
864 if (num6 < -128f || num6 > 127f)
869 result = (sbyte)num6;
872 if (typeof(TOther) == typeof(ushort))
874 ushort num7 = (ushort)(
object)
value;
880 result = (sbyte)num7;
883 if (typeof(TOther) == typeof(uint))
885 uint num8 = (uint)(
object)
value;
886 if ((
long)num8 > 127
L)
891 result = (sbyte)num8;
894 if (typeof(TOther) == typeof(ulong))
896 ulong num9 = (ulong)(
object)
value;
902 result = (sbyte)num9;
905 if (typeof(TOther) == typeof(
UIntPtr))
908 if ((nuint)uIntPtr > 127)
913 result = (sbyte)(nuint)uIntPtr;
921 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
924 return TryParse(
s, style, provider, out result);
927 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
930 return TryParse(
s, style, provider, out result);
933 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
936 return Parse(
s, provider);
939 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
945 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
948 return (sbyte)(
value << shiftAmount);
951 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
954 return (sbyte)(
value >> shiftAmount);
957 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
963 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
969 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
972 return (sbyte)(left - right);
975 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
978 return (sbyte)(-
value);
981 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal ToDecimal(object? value)
static long ToInt64(object? value)
static float ToSingle(object? value)
static short ToInt16(object? value)
static byte ToByte(object? value)
static uint ToUInt32(object? value)
static ulong ToUInt64(object? value)
static char ToChar(object? value)
static ushort ToUInt16(object? value)
static double ToDouble(object? value)
static bool ToBoolean([NotNullWhen(true)] object? value)
static object DefaultToType(IConvertible value, Type targetType, IFormatProvider provider)
static byte Clamp(byte value, byte min, byte max)
static byte Min(byte val1, byte val2)
static double Abs(double value)
static int DivRem(int a, int b, out int result)
static int Sign(decimal value)
static byte Max(byte val1, byte val2)
static void ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type=TypeCode.Empty)
static void ThrowOverflowException(TypeCode type)
static string FormatInt32(int value, int hexMask, string format, IFormatProvider provider)
static string Int32ToDecStr(int value)
static ParsingStatus TryParseInt32(ReadOnlySpan< char > value, NumberStyles styles, NumberFormatInfo info, out int result)
static bool TryFormatInt32(int value, int hexMask, ReadOnlySpan< char > format, IFormatProvider provider, Span< char > destination, out int charsWritten)
static int TrailingZeroCount(int value)
static bool IsPow2(int value)
static int PopCount(uint value)
static int Log2(uint value)
static int LeadingZeroCount(uint value)
static string InvalidCast_FromTo
static string Format(string resourceFormat, object p1)
static string Arg_MustBeSByte
static void ThrowNotSupportedException(ExceptionResource resource)
static void ThrowValueArgumentOutOfRange_NeedNonNegNumException()
static void ThrowArgumentNullException(string name)
static TResult AdditiveIdentity
static TSelf RotateRight(TSelf value, int rotateAmount)
static TSelf LeadingZeroCount(TSelf value)
static TSelf PopCount(TSelf value)
static TSelf TrailingZeroCount(TSelf value)
static TSelf RotateLeft(TSelf value, int rotateAmount)
static bool IsPow2(TSelf value)
static TSelf Log2(TSelf value)
short ToInt16(IFormatProvider? provider)
char ToChar(IFormatProvider? provider)
byte ToByte(IFormatProvider? provider)
decimal ToDecimal(IFormatProvider? provider)
object ToType(Type conversionType, IFormatProvider? provider)
uint ToUInt32(IFormatProvider? provider)
DateTime ToDateTime(IFormatProvider? provider)
int ToInt32(IFormatProvider? provider)
long ToInt64(IFormatProvider? provider)
ushort ToUInt16(IFormatProvider? provider)
double ToDouble(IFormatProvider? provider)
float ToSingle(IFormatProvider? provider)
sbyte ToSByte(IFormatProvider? provider)
ulong ToUInt64(IFormatProvider? provider)
bool ToBoolean(IFormatProvider? provider)
static TResult MultiplicativeIdentity
static TSelf Max(TSelf x, TSelf y)
static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out TSelf result)
static TSelf Parse(string s, NumberStyles style, IFormatProvider? provider)
static TSelf Sign(TSelf value)
static TSelf Min(TSelf x, TSelf y)
static TSelf Abs(TSelf value)
static TSelf Clamp(TSelf value, TSelf min, TSelf max)
static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out TSelf result)
static TSelf Parse(string s, IFormatProvider? provider)
static bool TryParse(ReadOnlySpan< char > s, IFormatProvider? provider, out TSelf result)
static TSelf Parse(ReadOnlySpan< char > s, IFormatProvider? provider)
static bool TryParse(ReadOnlySpan< char > s, out sbyte result)
static sbyte Parse(ReadOnlySpan< char > s, NumberStyles style=NumberStyles.Integer, IFormatProvider? provider=null)
string ToString(string? format)
static sbyte Parse(ReadOnlySpan< char > s, NumberStyles style, NumberFormatInfo info)
override bool Equals([NotNullWhen(true)] object? obj)
static sbyte Parse(string s, NumberStyles style, IFormatProvider? provider)
override string ToString()
static sbyte sbyte Remainder INumber< sbyte >. DivRem(sbyte left, sbyte right)
int CompareTo(object? obj)
int CompareTo(sbyte value)
static bool TryParse(ReadOnlySpan< char > s, NumberStyles style, IFormatProvider? provider, out sbyte result)
bool TryFormat(Span< char > destination, out int charsWritten, ReadOnlySpan< char > format=default(ReadOnlySpan< char >), IFormatProvider? provider=null)
string ToString(IFormatProvider? provider)
static bool TryParse([NotNullWhen(true)] string? s, out sbyte result)
static bool TryParse(ReadOnlySpan< char > s, NumberStyles style, NumberFormatInfo info, out sbyte result)
override int GetHashCode()
static sbyte Parse(string s, NumberStyles style)
static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out sbyte result)
static sbyte Parse(string s, IFormatProvider? provider)
string ToString(string? format, IFormatProvider? provider)
static sbyte Parse(string s)