10[TypeForwardedFrom(
"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
11public readonly
struct Int64 :
IComparable,
IConvertible,
ISpanFormattable,
IFormattable,
IComparable<long>,
IEquatable<long>,
IBinaryInteger<long>,
IBinaryNumber<long>,
IBitwiseOperators<long, long, long>,
INumber<long>,
IAdditionOperators<long, long, long>,
IAdditiveIdentity<long, long>,
IComparisonOperators<long, long>,
IEqualityOperators<long, long>,
IDecrementOperators<long>,
IDivisionOperators<long, long, long>,
IIncrementOperators<long>,
IModulusOperators<long, long, long>,
IMultiplicativeIdentity<long, long>,
IMultiplyOperators<long, long, long>,
ISpanParseable<long>,
IParseable<long>,
ISubtractionOperators<long, long, long>,
IUnaryNegationOperators<long, long>,
IUnaryPlusOperators<long, long>,
IShiftOperators<long, long>,
IMinMaxValue<long>,
ISignedNumber<long>
19 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
22 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
25 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
28 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
31 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
34 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
37 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
46 if (
value is
long num)
74 public override bool Equals([NotNullWhen(
true)]
object?
obj)
80 return this == (long)
obj;
91 return (
int)
this ^ (int)(
this >> 32);
163 public static bool TryParse([NotNullWhen(
true)]
string?
s, out
long result)
275 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
281 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
287 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
293 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
299 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
305 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
311 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
317 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
327 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
333 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
339 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
345 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
351 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
357 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
360 return left <= right;
363 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
369 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
372 return left >= right;
375 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
381 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
387 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
390 return left == right;
393 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
396 return left != right;
399 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
405 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
411 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
417 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
423 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
430 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
433 if (typeof(TOther) == typeof(
byte))
435 return (
byte)(object)
value;
437 if (typeof(TOther) == typeof(
char))
439 return (
char)(object)
value;
441 if (typeof(TOther) == typeof(decimal))
443 return (
long)(decimal)(
object)
value;
445 if (typeof(TOther) == typeof(
double))
447 return checked((
long)(
double)(
object)
value);
449 if (typeof(TOther) == typeof(
short))
451 return (
short)(object)
value;
453 if (typeof(TOther) == typeof(
int))
455 return (
int)(object)
value;
457 if (typeof(TOther) == typeof(
long))
459 return (
long)(object)
value;
461 if (typeof(TOther) == typeof(
IntPtr))
465 if (typeof(TOther) == typeof(sbyte))
467 return (sbyte)(object)
value;
471 if (typeof(TOther) == typeof(
float))
473 return (
long)(float)(
object)
value;
475 if (typeof(TOther) == typeof(ushort))
477 return (ushort)(object)
value;
479 if (typeof(TOther) == typeof(uint))
481 return (uint)(object)
value;
483 if (typeof(TOther) == typeof(ulong))
485 return (
long)(ulong)(
object)
value;
487 if (typeof(TOther) == typeof(
UIntPtr))
497 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
500 if (typeof(TOther) == typeof(
byte))
502 return (
byte)(object)
value;
504 if (typeof(TOther) == typeof(
char))
506 return (
char)(object)
value;
508 if (typeof(TOther) == typeof(decimal))
510 decimal num = (decimal)(
object)
value;
511 if (!(num > 9223372036854775807m))
513 if (!(num < -9223372036854775808m))
517 return long.MinValue;
519 return long.MaxValue;
521 if (typeof(TOther) == typeof(
double))
523 double num2 = (double)(
object)
value;
524 if (!(num2 > 9.223372036854776
E+18))
526 if (!(num2 < -9.223372036854776
E+18))
530 return long.MinValue;
532 return long.MaxValue;
534 if (typeof(TOther) == typeof(
short))
536 return (
short)(object)
value;
538 if (typeof(TOther) == typeof(
int))
540 return (
int)(object)
value;
542 if (typeof(TOther) == typeof(
long))
544 return (
long)(object)
value;
546 if (typeof(TOther) == typeof(
IntPtr))
550 if (typeof(TOther) == typeof(sbyte))
552 return (sbyte)(object)
value;
554 if (typeof(TOther) == typeof(
float))
556 float num3 = (float)(
object)
value;
557 if (!(num3 > 9.223372
E+18f))
559 if (!(num3 < -9.223372
E+18f))
563 return long.MinValue;
565 return long.MaxValue;
567 if (typeof(TOther) == typeof(ushort))
569 return (ushort)(object)
value;
571 if (typeof(TOther) == typeof(uint))
573 return (uint)(object)
value;
575 if (typeof(TOther) == typeof(ulong))
577 ulong num4 = (ulong)(
object)
value;
582 return long.MaxValue;
584 if (typeof(TOther) == typeof(
UIntPtr))
587 if ((ulong)(nuint)uIntPtr <= 9223372036854775807uL)
589 return (
long)(nuint)uIntPtr;
598 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
601 if (typeof(TOther) == typeof(
byte))
603 return (
byte)(object)
value;
605 if (typeof(TOther) == typeof(
char))
607 return (
char)(object)
value;
609 if (typeof(TOther) == typeof(decimal))
611 return (
long)(decimal)(
object)
value;
613 if (typeof(TOther) == typeof(
double))
615 return (
long)(double)(
object)
value;
617 if (typeof(TOther) == typeof(
short))
619 return (
short)(object)
value;
621 if (typeof(TOther) == typeof(
int))
623 return (
int)(object)
value;
625 if (typeof(TOther) == typeof(
long))
627 return (
long)(object)
value;
629 if (typeof(TOther) == typeof(
IntPtr))
633 if (typeof(TOther) == typeof(sbyte))
635 return (sbyte)(object)
value;
637 if (typeof(TOther) == typeof(
float))
639 return (
long)(float)(
object)
value;
641 if (typeof(TOther) == typeof(ushort))
643 return (ushort)(object)
value;
645 if (typeof(TOther) == typeof(uint))
647 return (uint)(object)
value;
649 if (typeof(TOther) == typeof(ulong))
651 return (
long)(ulong)(
object)
value;
653 if (typeof(TOther) == typeof(
UIntPtr))
661 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
667 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
673 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
679 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
682 return Parse(
s, style, provider);
685 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
688 return Parse(
s, style, provider);
691 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
698 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
701 if (typeof(TOther) == typeof(
byte))
703 result = (byte)(
object)
value;
706 if (typeof(TOther) == typeof(
char))
708 result = (char)(
object)
value;
711 if (typeof(TOther) == typeof(decimal))
713 decimal num = (decimal)(
object)
value;
714 if (num < -9223372036854775808m || num > 9223372036854775807m)
722 if (typeof(TOther) == typeof(
double))
724 double num2 = (double)(
object)
value;
725 if (num2 < -9.223372036854776E+18 || num2 > 9.223372036854776
E+18)
733 if (typeof(TOther) == typeof(
short))
738 if (typeof(TOther) == typeof(
int))
740 result = (int)(
object)
value;
743 if (typeof(TOther) == typeof(
long))
745 result = (long)(
object)
value;
748 if (typeof(TOther) == typeof(
IntPtr))
753 if (typeof(TOther) == typeof(sbyte))
755 result = (sbyte)(
object)
value;
758 if (typeof(TOther) == typeof(
float))
760 float num3 = (float)(
object)
value;
761 if (num3 < -9.223372E+18f || num3 > 9.223372
E+18f)
769 if (typeof(TOther) == typeof(ushort))
771 result = (ushort)(
object)
value;
774 if (typeof(TOther) == typeof(uint))
776 result = (uint)(
object)
value;
779 if (typeof(TOther) == typeof(ulong))
781 ulong num4 = (ulong)(
object)
value;
790 if (typeof(TOther) == typeof(
UIntPtr))
793 if ((ulong)(nuint)uIntPtr > 9223372036854775807uL)
798 result = (long)(nuint)uIntPtr;
806 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
809 return TryParse(
s, style, provider, out result);
812 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
815 return TryParse(
s, style, provider, out result);
818 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
821 return Parse(
s, provider);
824 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
830 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
833 return value << shiftAmount;
836 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
839 return value >> shiftAmount;
842 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
848 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
854 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
860 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
866 [RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal ToDecimal(object? value)
static float ToSingle(object? value)
static int ToInt32(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 sbyte ToSByte(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 bool TryFormatInt64(long value, ReadOnlySpan< char > format, IFormatProvider provider, Span< char > destination, out int charsWritten)
static string Int64ToDecStr(long value)
static long ParseInt64(ReadOnlySpan< char > value, NumberStyles styles, NumberFormatInfo info)
static ParsingStatus TryParseInt64IntegerStyle(ReadOnlySpan< char > value, NumberStyles styles, NumberFormatInfo info, out long result)
static ParsingStatus TryParseInt64(ReadOnlySpan< char > value, NumberStyles styles, NumberFormatInfo info, out long result)
static string FormatInt64(long value, string format, IFormatProvider provider)
static int TrailingZeroCount(int value)
static bool IsPow2(int value)
static int PopCount(uint value)
static int Log2(uint value)
static uint RotateRight(uint value, int offset)
static int LeadingZeroCount(uint value)
static uint RotateLeft(uint value, int offset)
static string InvalidCast_FromTo
static string Format(string resourceFormat, object p1)
static string Arg_MustBeInt64
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 long Parse(string s, IFormatProvider? provider)
static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out long result)
static long Parse(string s)
static bool TryParse(ReadOnlySpan< char > s, NumberStyles style, IFormatProvider? provider, out long result)
static long Parse(string s, NumberStyles style, IFormatProvider? provider)
int CompareTo(long value)
override bool Equals([NotNullWhen(true)] object? obj)
static long long Remainder INumber< long >. DivRem(long left, long right)
static bool TryParse(ReadOnlySpan< char > s, out long result)
string ToString(string? format)
static bool TryParse([NotNullWhen(true)] string? s, out long result)
int CompareTo(object? value)
override int GetHashCode()
string ToString(string? format, IFormatProvider? provider)
bool TryFormat(Span< char > destination, out int charsWritten, ReadOnlySpan< char > format=default(ReadOnlySpan< char >), IFormatProvider? provider=null)
override string ToString()
static long Parse(ReadOnlySpan< char > s, NumberStyles style=NumberStyles.Integer, IFormatProvider? provider=null)
string ToString(IFormatProvider? provider)
static long Parse(string s, NumberStyles style)