119 instantiations of Decimal64
System.Private.CoreLib (119)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal32.cs (1)
701
public static implicit operator Decimal64(Decimal32 value) => new
Decimal64
(Number.ConvertDecimalIeee754<Decimal32, uint, Decimal64, ulong>(value._value));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal64.cs (118)
72
public static Decimal64 PositiveInfinity => new
Decimal64
(PositiveInfinityValue);
75
public static Decimal64 NegativeInfinity => new
Decimal64
(NegativeInfinityValue);
78
public static Decimal64 NaN => new
Decimal64
(QuietNaNValue);
81
public static Decimal64 NegativeZero => new
Decimal64
(NegativeZeroValue);
84
public static Decimal64 Zero => new
Decimal64
(ZeroValue);
87
public static Decimal64 MinValue => new
Decimal64
(MinInternalValue);
90
public static Decimal64 MaxValue => new
Decimal64
(MaxInternalValue);
93
public static Decimal64 Epsilon => new
Decimal64
(0x0000_0000_0000_0001); // Smallest positive subnormal value, aka 1 * 10^-398
279
public static Decimal64 DecodeBinary(ulong x) => new
Decimal64
(x);
291
public static Decimal64 DecodeDecimal(ulong x) => new
Decimal64
(Number.DecodeDecimalIeee754<Decimal64, ulong>(x));
345
public static Decimal64 operator -(Decimal64 value) => new
Decimal64
(value._value ^ SignMask);
352
return new
Decimal64
(Number.AddDecimalIeee754<Decimal64, ulong>(value._value, OneValue));
360
return new
Decimal64
(Number.SubtractDecimalIeee754<Decimal64, ulong>(value._value, OneValue));
369
return new
Decimal64
(Number.AddDecimalIeee754<Decimal64, ulong>(left._value, right._value));
378
return new
Decimal64
(Number.SubtractDecimalIeee754<Decimal64, ulong>(left._value, right._value));
387
return new
Decimal64
(Number.MultiplyDecimalIeee754<Decimal64, ulong>(left._value, right._value));
396
return new
Decimal64
(Number.DivideDecimalIeee754<Decimal64, ulong>(left._value, right._value));
405
return new
Decimal64
(Number.RemainderDecimalIeee754<Decimal64, ulong>(left._value, right._value));
415
public static explicit operator Decimal64(nint value) => new
Decimal64
(Number.ConvertIntegerToDecimalIeee754<Decimal64, ulong, nint>(value));
421
public static explicit operator Decimal64(nuint value) => new
Decimal64
(Number.ConvertIntegerToDecimalIeee754<Decimal64, ulong, nuint>(value));
426
public static explicit operator Decimal64(long value) => new
Decimal64
(Number.ConvertIntegerToDecimalIeee754<Decimal64, ulong, long>(value));
432
public static explicit operator Decimal64(ulong value) => new
Decimal64
(Number.ConvertIntegerToDecimalIeee754<Decimal64, ulong, ulong>(value));
437
public static explicit operator Decimal64(Int128 value) => new
Decimal64
(Number.ConvertIntegerToDecimalIeee754<Decimal64, ulong, Int128>(value));
443
public static explicit operator Decimal64(UInt128 value) => new
Decimal64
(Number.ConvertIntegerToDecimalIeee754<Decimal64, ulong, UInt128>(value));
448
public static explicit operator Decimal64(Half value) => new
Decimal64
(Number.ConvertFloatToDecimalIeee754<Half, Decimal64, ulong>(value));
453
public static explicit operator Decimal64(float value) => new
Decimal64
(Number.ConvertFloatToDecimalIeee754<float, Decimal64, ulong>(value));
458
public static explicit operator Decimal64(double value) => new
Decimal64
(Number.ConvertFloatToDecimalIeee754<double, Decimal64, ulong>(value));
463
public static explicit operator Decimal64(Decimal128 value) => new
Decimal64
(Number.ConvertDecimalIeee754<Decimal128, UInt128, Decimal64, ulong>(new UInt128(value._upper, value._lower)));
468
public static explicit operator Decimal64(decimal value) => new
Decimal64
(Number.ConvertDecimalToDecimalIeee754<Decimal64, ulong>(value));
657
public static implicit operator Decimal64(byte value) => new
Decimal64
(Number.ConvertIntegerToDecimalIeee754<Decimal64, ulong, byte>(value));
663
public static implicit operator Decimal64(sbyte value) => new
Decimal64
(Number.ConvertIntegerToDecimalIeee754<Decimal64, ulong, sbyte>(value));
668
public static implicit operator Decimal64(char value) => new
Decimal64
(Number.ConvertIntegerToDecimalIeee754<Decimal64, ulong, ushort>(value));
673
public static implicit operator Decimal64(short value) => new
Decimal64
(Number.ConvertIntegerToDecimalIeee754<Decimal64, ulong, short>(value));
679
public static implicit operator Decimal64(ushort value) => new
Decimal64
(Number.ConvertIntegerToDecimalIeee754<Decimal64, ulong, ushort>(value));
684
public static implicit operator Decimal64(int value) => new
Decimal64
(Number.ConvertIntegerToDecimalIeee754<Decimal64, ulong, int>(value));
690
public static implicit operator Decimal64(uint value) => new
Decimal64
(Number.ConvertIntegerToDecimalIeee754<Decimal64, ulong, uint>(value));
802
public static Decimal64 One => new
Decimal64
(OneValue);
805
public static Decimal64 NegativeOne => new
Decimal64
(NegativeOneValue);
808
public static Decimal64 E => new
Decimal64
(EValue);
811
public static Decimal64 Pi => new
Decimal64
(PiValue);
814
public static Decimal64 Tau => new
Decimal64
(TauValue);
821
public static Decimal64 Ceiling(Decimal64 x) => new
Decimal64
(Number.RoundDecimalIeee754<Decimal64, ulong>(x._value, 0, MidpointRounding.ToPositiveInfinity));
832
public static Decimal64 Floor(Decimal64 x) => new
Decimal64
(Number.RoundDecimalIeee754<Decimal64, ulong>(x._value, 0, MidpointRounding.ToNegativeInfinity));
835
public static Decimal64 Round(Decimal64 x) => new
Decimal64
(Number.RoundDecimalIeee754<Decimal64, ulong>(x._value, 0, MidpointRounding.ToEven));
838
public static Decimal64 Round(Decimal64 x, int digits) => new
Decimal64
(Number.RoundDecimalIeee754<Decimal64, ulong>(x._value, digits, MidpointRounding.ToEven));
841
public static Decimal64 Round(Decimal64 x, MidpointRounding mode) => new
Decimal64
(Number.RoundDecimalIeee754<Decimal64, ulong>(x._value, 0, mode));
844
public static Decimal64 Round(Decimal64 x, int digits, MidpointRounding mode) => new
Decimal64
(Number.RoundDecimalIeee754<Decimal64, ulong>(x._value, digits, mode));
847
public static Decimal64 Truncate(Decimal64 x) => new
Decimal64
(Number.RoundDecimalIeee754<Decimal64, ulong>(x._value, 0, MidpointRounding.ToZero));
930
public static Decimal64 Acos(Decimal64 x) => new
Decimal64
(Number.AcosDecimalIeee754<Decimal64, ulong>(x._value));
933
public static Decimal64 AcosPi(Decimal64 x) => new
Decimal64
(Number.AcosPiDecimalIeee754<Decimal64, ulong>(x._value));
936
public static Decimal64 Acosh(Decimal64 x) => new
Decimal64
(Number.AcoshDecimalIeee754<Decimal64, ulong>(x._value));
939
public static Decimal64 Asin(Decimal64 x) => new
Decimal64
(Number.AsinDecimalIeee754<Decimal64, ulong>(x._value));
942
public static Decimal64 AsinPi(Decimal64 x) => new
Decimal64
(Number.AsinPiDecimalIeee754<Decimal64, ulong>(x._value));
945
public static Decimal64 Asinh(Decimal64 x) => new
Decimal64
(Number.AsinhDecimalIeee754<Decimal64, ulong>(x._value));
948
public static Decimal64 Atan(Decimal64 x) => new
Decimal64
(Number.AtanDecimalIeee754<Decimal64, ulong>(x._value));
951
public static Decimal64 Atan2(Decimal64 y, Decimal64 x) => new
Decimal64
(Number.Atan2DecimalIeee754<Decimal64, ulong>(y._value, x._value));
954
public static Decimal64 Atan2Pi(Decimal64 y, Decimal64 x) => new
Decimal64
(Number.Atan2PiDecimalIeee754<Decimal64, ulong>(y._value, x._value));
957
public static Decimal64 AtanPi(Decimal64 x) => new
Decimal64
(Number.AtanPiDecimalIeee754<Decimal64, ulong>(x._value));
960
public static Decimal64 Atanh(Decimal64 x) => new
Decimal64
(Number.AtanhDecimalIeee754<Decimal64, ulong>(x._value));
963
public static Decimal64 BitDecrement(Decimal64 x) => new
Decimal64
(Number.BitDecrementDecimalIeee754<Decimal64, ulong>(x._value));
966
public static Decimal64 BitIncrement(Decimal64 x) => new
Decimal64
(Number.BitIncrementDecimalIeee754<Decimal64, ulong>(x._value));
969
public static Decimal64 Cbrt(Decimal64 x) => new
Decimal64
(Number.CbrtDecimalIeee754<Decimal64, ulong>(x._value));
972
public static Decimal64 Cos(Decimal64 x) => new
Decimal64
(Number.CosDecimalIeee754<Decimal64, ulong>(x._value));
975
public static Decimal64 CosPi(Decimal64 x) => new
Decimal64
(Number.CosPiDecimalIeee754<Decimal64, ulong>(x._value));
978
public static Decimal64 Cosh(Decimal64 x) => new
Decimal64
(Number.CoshDecimalIeee754<Decimal64, ulong>(x._value));
981
public static Decimal64 DegreesToRadians(Decimal64 degrees) => new
Decimal64
(Number.MultiplyByWideConstantDecimalIeee754<Decimal64, ulong>(degrees._value, DegreesToRadiansHead, DegreesToRadiansTail, DegreesToRadiansExponent));
984
public static Decimal64 Exp(Decimal64 x) => new
Decimal64
(Number.ExpDecimalIeee754<Decimal64, ulong>(x._value));
987
public static Decimal64 Exp10(Decimal64 x) => new
Decimal64
(Number.Exp10DecimalIeee754<Decimal64, ulong>(x._value));
990
public static Decimal64 Exp10M1(Decimal64 x) => new
Decimal64
(Number.Exp10M1DecimalIeee754<Decimal64, ulong>(x._value));
993
public static Decimal64 Exp2(Decimal64 x) => new
Decimal64
(Number.Exp2DecimalIeee754<Decimal64, ulong>(x._value));
996
public static Decimal64 Exp2M1(Decimal64 x) => new
Decimal64
(Number.Exp2M1DecimalIeee754<Decimal64, ulong>(x._value));
999
public static Decimal64 ExpM1(Decimal64 x) => new
Decimal64
(Number.ExpM1DecimalIeee754<Decimal64, ulong>(x._value));
1002
public static Decimal64 FusedMultiplyAdd(Decimal64 left, Decimal64 right, Decimal64 addend) => new
Decimal64
(Number.FusedMultiplyAddDecimalIeee754<Decimal64, ulong>(left._value, right._value, addend._value));
1005
public static Decimal64 Hypot(Decimal64 x, Decimal64 y) => new
Decimal64
(Number.HypotDecimalIeee754<Decimal64, ulong>(x._value, y._value));
1008
public static Decimal64 Ieee754Remainder(Decimal64 left, Decimal64 right) => new
Decimal64
(Number.Ieee754RemainderDecimalIeee754<Decimal64, ulong>(left._value, right._value));
1017
public static Decimal64 Log(Decimal64 x) => new
Decimal64
(Number.LogDecimalIeee754<Decimal64, ulong>(x._value));
1020
public static Decimal64 Log(Decimal64 x, Decimal64 newBase) => new
Decimal64
(Number.LogDecimalIeee754<Decimal64, ulong>(x._value, newBase._value));
1023
public static Decimal64 Log10(Decimal64 x) => new
Decimal64
(Number.Log10DecimalIeee754<Decimal64, ulong>(x._value));
1026
public static Decimal64 Log10P1(Decimal64 x) => new
Decimal64
(Number.Log10P1DecimalIeee754<Decimal64, ulong>(x._value));
1029
public static Decimal64 Log2(Decimal64 x) => new
Decimal64
(Number.Log2DecimalIeee754<Decimal64, ulong>(x._value));
1032
public static Decimal64 Log2P1(Decimal64 x) => new
Decimal64
(Number.Log2P1DecimalIeee754<Decimal64, ulong>(x._value));
1035
public static Decimal64 LogP1(Decimal64 x) => new
Decimal64
(Number.LogP1DecimalIeee754<Decimal64, ulong>(x._value));
1038
public static Decimal64 Pow(Decimal64 x, Decimal64 y) => new
Decimal64
(Number.PowDecimalIeee754<Decimal64, ulong>(x._value, y._value));
1041
public static Decimal64 RadiansToDegrees(Decimal64 radians) => new
Decimal64
(Number.MultiplyByWideConstantDecimalIeee754<Decimal64, ulong>(radians._value, RadiansToDegreesHead, RadiansToDegreesTail, RadiansToDegreesExponent));
1050
public static Decimal64 RootN(Decimal64 x, int n) => new
Decimal64
(Number.RootNDecimalIeee754<Decimal64, ulong>(x._value, n));
1053
public static Decimal64 ScaleB(Decimal64 x, int n) => new
Decimal64
(Number.ScaleBDecimalIeee754<Decimal64, ulong>(x._value, n));
1056
public static Decimal64 Sin(Decimal64 x) => new
Decimal64
(Number.SinDecimalIeee754<Decimal64, ulong>(x._value));
1062
return (new
Decimal64
(sin), new
Decimal64
(cos));
1069
return (new
Decimal64
(sin), new
Decimal64
(cos));
1073
public static Decimal64 SinPi(Decimal64 x) => new
Decimal64
(Number.SinPiDecimalIeee754<Decimal64, ulong>(x._value));
1076
public static Decimal64 Sinh(Decimal64 x) => new
Decimal64
(Number.SinhDecimalIeee754<Decimal64, ulong>(x._value));
1079
public static Decimal64 Sqrt(Decimal64 x) => new
Decimal64
(Number.SqrtDecimalIeee754<Decimal64, ulong>(x._value));
1082
public static Decimal64 Tan(Decimal64 x) => new
Decimal64
(Number.TanDecimalIeee754<Decimal64, ulong>(x._value));
1085
public static Decimal64 TanPi(Decimal64 x) => new
Decimal64
(Number.TanPiDecimalIeee754<Decimal64, ulong>(x._value));
1088
public static Decimal64 Tanh(Decimal64 x) => new
Decimal64
(Number.TanhDecimalIeee754<Decimal64, ulong>(x._value));
1094
public static Decimal64 Quantize(Decimal64 x, Decimal64 y) => new
Decimal64
(Number.QuantizeDecimalIeee754<Decimal64, ulong>(x._value, y._value));
1099
public static Decimal64 GetQuantum(Decimal64 x) => new
Decimal64
(Number.QuantumDecimalIeee754<Decimal64, ulong>(x._value));
1110
public static Decimal64 Abs(Decimal64 value) => new
Decimal64
(Number.AbsDecimalIeee754<Decimal64, ulong>(value._value));
1181
public static Decimal64 MaxMagnitude(Decimal64 x, Decimal64 y) => new
Decimal64
(Number.MaxMagnitudeDecimalIeee754<Decimal64, ulong>(x._value, y._value));
1187
public static Decimal64 MaxMagnitudeNumber(Decimal64 x, Decimal64 y) => new
Decimal64
(Number.MaxMagnitudeNumberDecimalIeee754<Decimal64, ulong>(x._value, y._value));
1193
public static Decimal64 MinMagnitude(Decimal64 x, Decimal64 y) => new
Decimal64
(Number.MinMagnitudeDecimalIeee754<Decimal64, ulong>(x._value, y._value));
1199
public static Decimal64 MinMagnitudeNumber(Decimal64 x, Decimal64 y) => new
Decimal64
(Number.MinMagnitudeNumberDecimalIeee754<Decimal64, ulong>(x._value, y._value));
1242
public static Decimal64 CopySign(Decimal64 value, Decimal64 sign) => new
Decimal64
(Number.CopySignDecimalIeee754<Decimal64, ulong>(value._value, sign._value));
1248
public static Decimal64 Max(Decimal64 x, Decimal64 y) => new
Decimal64
(Number.MaxDecimalIeee754<Decimal64, ulong>(x._value, y._value));
1254
public static Decimal64 MaxNative(Decimal64 x, Decimal64 y) => new
Decimal64
(Number.MaxNativeDecimalIeee754<Decimal64, ulong>(x._value, y._value));
1260
public static Decimal64 MaxNumber(Decimal64 x, Decimal64 y) => new
Decimal64
(Number.MaxNumberDecimalIeee754<Decimal64, ulong>(x._value, y._value));
1266
public static Decimal64 Min(Decimal64 x, Decimal64 y) => new
Decimal64
(Number.MinDecimalIeee754<Decimal64, ulong>(x._value, y._value));
1272
public static Decimal64 MinNative(Decimal64 x, Decimal64 y) => new
Decimal64
(Number.MinNativeDecimalIeee754<Decimal64, ulong>(x._value, y._value));
1278
public static Decimal64 MinNumber(Decimal64 x, Decimal64 y) => new
Decimal64
(Number.MinNumberDecimalIeee754<Decimal64, ulong>(x._value, y._value));
1751
static Decimal64 IDecimalIeee754ParseAndFormatInfo<Decimal64, ulong>.Construct(ulong value) => new
Decimal64
(value);
1807
static bool IDecimalIeee754ParseAndFormatInfo<Decimal64, ulong>.IsNaN(ulong decimalBits) => IsNaN(new
Decimal64
(decimalBits));
1809
static bool IDecimalIeee754ParseAndFormatInfo<Decimal64, ulong>.IsNegative(ulong decimalBits) => IsNegative(new
Decimal64
(decimalBits));
1811
static bool IDecimalIeee754ParseAndFormatInfo<Decimal64, ulong>.IsFinite(ulong decimalBits) => IsFinite(new
Decimal64
(decimalBits));
1813
static bool IDecimalIeee754ParseAndFormatInfo<Decimal64, ulong>.IsInfinity(ulong decimalBits) => IsInfinity(new
Decimal64
(decimalBits));
1815
static bool IDecimalIeee754ParseAndFormatInfo<Decimal64, ulong>.IsPositiveInfinity(ulong decimalBits) => IsPositiveInfinity(new
Decimal64
(decimalBits));
1817
static bool IDecimalIeee754ParseAndFormatInfo<Decimal64, ulong>.IsNegativeInfinity(ulong decimalBits) => IsNegativeInfinity(new
Decimal64
(decimalBits));
715 references to Decimal64
System.Private.CoreLib (708)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal128.cs (6)
1470
else if (typeof(TOther) == typeof(
Decimal64
))
1472
result = (
Decimal64
)(object)value;
1593
else if (typeof(TOther) == typeof(
Decimal64
))
1595
result = (TOther)(object)(
Decimal64
)value;
1715
else if (typeof(TOther) == typeof(
Decimal64
))
1717
result = (TOther)(object)(
Decimal64
)value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal32.cs (13)
468
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="System.Numerics.Decimal32" /> value.</summary>
471
public static explicit operator Decimal32(
Decimal64
value) => new Decimal32(Number.ConvertDecimalIeee754<
Decimal64
, ulong, Decimal32, uint>(value._value));
698
/// <summary>Implicitly converts a <see cref="System.Numerics.Decimal32" /> value to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</summary>
700
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</returns>
701
public static implicit operator
Decimal64
(Decimal32 value) => new Decimal64(Number.ConvertDecimalIeee754<Decimal32, uint,
Decimal64
, ulong>(value._value));
1476
else if (typeof(TOther) == typeof(
Decimal64
))
1478
result = (Decimal32)(
Decimal64
)(object)value;
1599
else if (typeof(TOther) == typeof(
Decimal64
))
1601
result = (TOther)(object)(
Decimal64
)value;
1726
else if (typeof(TOther) == typeof(
Decimal64
))
1728
result = (TOther)(object)(
Decimal64
)value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal64.cs (685)
21
IComparable<
Decimal64
>,
22
IEquatable<
Decimal64
>,
23
IDecimalFloatingPointIeee754<
Decimal64
>,
25
ISpanParsable<
Decimal64
>,
26
IMinMaxValue<
Decimal64
>,
28
IUtf8SpanParsable<
Decimal64
>,
29
IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>
72
public static
Decimal64
PositiveInfinity => new Decimal64(PositiveInfinityValue);
75
public static
Decimal64
NegativeInfinity => new Decimal64(NegativeInfinityValue);
78
public static
Decimal64
NaN => new Decimal64(QuietNaNValue);
81
public static
Decimal64
NegativeZero => new Decimal64(NegativeZeroValue);
84
public static
Decimal64
Zero => new Decimal64(ZeroValue);
87
public static
Decimal64
MinValue => new Decimal64(MinInternalValue);
90
public static
Decimal64
MaxValue => new Decimal64(MaxInternalValue);
93
public static
Decimal64
Epsilon => new Decimal64(0x0000_0000_0000_0001); // Smallest positive subnormal value, aka 1 * 10^-398
121
/// Parses a <see cref="
Decimal64
"/> from a <see cref="string"/> in the default parse style.
124
/// <returns>The equivalent <see cref="
Decimal64
"/> value representing the input string. If the input exceeds Decimal64's range, a <see cref="PositiveInfinity"/> or <see cref="NegativeInfinity"/> is returned. </returns>
125
public static
Decimal64
Parse(string s) => Parse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider: null);
128
/// Parses a <see cref="
Decimal64
"/> from a <see cref="string"/> in the given <see cref="NumberStyles"/>.
132
/// <returns>The equivalent <see cref="
Decimal64
"/> value representing the input string. If the input exceeds Decimal64's range, a <see cref="PositiveInfinity"/> or <see cref="NegativeInfinity"/> is returned. </returns>
133
public static
Decimal64
Parse(string s, NumberStyles style) => Parse(s, style, provider: null);
136
public static
Decimal64
Parse(ReadOnlySpan<char> s, IFormatProvider? provider) => Parse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider);
139
/// Parses a <see cref="
Decimal64
"/> from a <see cref="string"/> and <see cref="IFormatProvider"/>.
143
/// <returns>The equivalent <see cref="
Decimal64
"/> value representing the input string. If the input exceeds Decimal64's range, a <see cref="PositiveInfinity"/> or <see cref="NegativeInfinity"/> is returned. </returns>
144
public static
Decimal64
Parse(string s, IFormatProvider? provider) => Parse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider);
147
/// Parses a <see cref="
Decimal64
"/> from a <see cref="ReadOnlySpan{Char}"/> and <see cref="IFormatProvider"/>.
152
/// <returns>The equivalent <see cref="
Decimal64
"/> value representing the input string. If the input exceeds Decimal64's range, a <see cref="PositiveInfinity"/> or <see cref="NegativeInfinity"/> is returned. </returns>
153
public static
Decimal64
Parse(ReadOnlySpan<char> s, NumberStyles style = NumberStyles.Float | NumberStyles.AllowThousands, IFormatProvider? provider = null)
156
return Number.ParseDecimalIeee754<char,
Decimal64
, ulong>(s, style, NumberFormatInfo.GetInstance(provider));
160
/// Parses a <see cref="
Decimal64
"/> from a <see cref="string"/> with the given <see cref="NumberStyles"/> and <see cref="IFormatProvider"/>.
165
/// <returns>The equivalent <see cref="
Decimal64
"/> value representing the input string. If the input exceeds Decimal64's range, a <see cref="PositiveInfinity"/> or <see cref="NegativeInfinity"/> is returned. </returns>
166
public static
Decimal64
Parse(string s, NumberStyles style, IFormatProvider? provider)
176
/// Tries to parse a <see cref="
Decimal64
"/> from a <see cref="string"/> in the default parse style.
179
/// <param name="result">The equivalent <see cref="
Decimal64
"/> value representing the input string if the parse was successful. If the input exceeds Decimal64's range, a <see cref="PositiveInfinity"/> or <see cref="NegativeInfinity"/> is returned. If the parse was unsuccessful, a default <see cref="
Decimal64
"/> value is returned.</param>
181
public static bool TryParse([NotNullWhen(true)] string? s, out
Decimal64
result) => TryParse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider: null, out result);
184
/// Tries to parse a <see cref="
Decimal64
"/> from a <see cref="ReadOnlySpan{Char}"/> in the default parse style.
187
/// <param name="result">The equivalent <see cref="
Decimal64
"/> value representing the input string if the parse was successful. If the input exceeds Decimal64's range, a <see cref="PositiveInfinity"/> or <see cref="NegativeInfinity"/> is returned. If the parse was unsuccessful, a default <see cref="
Decimal64
"/> value is returned.</param>
189
public static bool TryParse(ReadOnlySpan<char> s, out
Decimal64
result) => TryParse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider: null, out result);
192
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, [MaybeNullWhen(false)] out
Decimal64
result) => TryParse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider, out result);
195
/// Tries to parse a <see cref="
Decimal64
"/> from a <see cref="string"/> with the given <see cref="IFormatProvider"/>.
199
/// <param name="result">The equivalent <see cref="
Decimal64
"/> value representing the input string if the parse was successful. If the input exceeds Decimal64's range, a <see cref="PositiveInfinity"/> or <see cref="NegativeInfinity"/> is returned. If the parse was unsuccessful, a default <see cref="
Decimal64
"/> value is returned.</param>
201
public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, [MaybeNullWhen(false)] out
Decimal64
result) => TryParse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider, out result);
204
/// Tries to parse a <see cref="
Decimal64
"/> from a <see cref="ReadOnlySpan{Char}"/> with the given <see cref="NumberStyles"/> and <see cref="IFormatProvider"/>.
209
/// <param name="result">The equivalent <see cref="
Decimal64
"/> value representing the input string if the parse was successful. If the input exceeds Decimal64's range, a <see cref="PositiveInfinity"/> or <see cref="NegativeInfinity"/> is returned. If the parse was unsuccessful, a default <see cref="
Decimal64
"/> value is returned.</param>
211
public static bool TryParse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider? provider, [MaybeNullWhen(false)] out
Decimal64
result)
214
return Number.TryParseDecimalIeee754<char,
Decimal64
, ulong>(s, style, NumberFormatInfo.GetInstance(provider), out result, out _) == Number.ParsingStatus.OK;
218
/// Tries to parse a <see cref="
Decimal64
"/> from a <see cref="string"/> with the given <see cref="NumberStyles"/> and <see cref="IFormatProvider"/>.
223
/// <param name="result">The equivalent <see cref="
Decimal64
"/> value representing the input string if the parse was successful. If the input exceeds Decimal64's range, a <see cref="PositiveInfinity"/> or <see cref="NegativeInfinity"/> is returned. If the parse was unsuccessful, a default <see cref="
Decimal64
"/> value is returned.</param>
225
public static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, [MaybeNullWhen(false)] out
Decimal64
result)
228
return Number.TryParseDecimalIeee754<char,
Decimal64
, ulong>(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) == Number.ParsingStatus.OK;
234
if (value is not
Decimal64
other)
242
public int CompareTo(
Decimal64
other)
244
return Number.CompareDecimalIeee754<
Decimal64
, ulong>(_value, other._value);
248
public bool Equals(
Decimal64
other)
250
return Number.CompareDecimalIeee754<
Decimal64
, ulong>(_value, other._value) == 0;
258
return obj is
Decimal64
other && Equals(other);
266
return Number.GetDecimalIeee754HashCode<
Decimal64
, ulong>(_value);
273
public static ulong EncodeBinary(
Decimal64
x) => x._value;
279
public static
Decimal64
DecodeBinary(ulong x) => new Decimal64(x);
285
public static ulong EncodeDecimal(
Decimal64
x) => Number.EncodeDecimalIeee754<
Decimal64
, ulong>(x._value);
291
public static
Decimal64
DecodeDecimal(ulong x) => new Decimal64(Number.DecodeDecimalIeee754<
Decimal64
, ulong>(x));
298
return Number.FormatDecimalIeee754<
Decimal64
, ulong>(_value, null, NumberFormatInfo.CurrentInfo);
306
return Number.FormatDecimalIeee754<
Decimal64
, ulong>(_value, format, NumberFormatInfo.CurrentInfo);
314
return Number.FormatDecimalIeee754<
Decimal64
, ulong>(_value, null, NumberFormatInfo.GetInstance(provider));
322
return Number.FormatDecimalIeee754<
Decimal64
, ulong>(_value, format, NumberFormatInfo.GetInstance(provider));
328
return Number.TryFormatDecimalIeee754<
Decimal64
, ulong, char>(_value, format, NumberFormatInfo.GetInstance(provider), destination, out charsWritten);
334
return Number.TryFormatDecimalIeee754<
Decimal64
, ulong, byte>(_value, format, NumberFormatInfo.GetInstance(provider), utf8Destination, out bytesWritten);
340
public static
Decimal64
operator +(
Decimal64
value) => value;
345
public static
Decimal64
operator -(
Decimal64
value) => new Decimal64(value._value ^ SignMask);
350
public static
Decimal64
operator ++(
Decimal64
value)
352
return new Decimal64(Number.AddDecimalIeee754<
Decimal64
, ulong>(value._value, OneValue));
358
public static
Decimal64
operator --(
Decimal64
value)
360
return new Decimal64(Number.SubtractDecimalIeee754<
Decimal64
, ulong>(value._value, OneValue));
367
public static
Decimal64
operator +(
Decimal64
left,
Decimal64
right)
369
return new Decimal64(Number.AddDecimalIeee754<
Decimal64
, ulong>(left._value, right._value));
376
public static
Decimal64
operator -(
Decimal64
left,
Decimal64
right)
378
return new Decimal64(Number.SubtractDecimalIeee754<
Decimal64
, ulong>(left._value, right._value));
385
public static
Decimal64
operator *(
Decimal64
left,
Decimal64
right)
387
return new Decimal64(Number.MultiplyDecimalIeee754<
Decimal64
, ulong>(left._value, right._value));
394
public static
Decimal64
operator /(
Decimal64
left,
Decimal64
right)
396
return new Decimal64(Number.DivideDecimalIeee754<
Decimal64
, ulong>(left._value, right._value));
403
public static
Decimal64
operator %(
Decimal64
left,
Decimal64
right)
405
return new Decimal64(Number.RemainderDecimalIeee754<
Decimal64
, ulong>(left._value, right._value));
412
/// <summary>Explicitly converts a <see cref="System.IntPtr" /> value to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</summary>
414
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</returns>
415
public static explicit operator
Decimal64
(nint value) => new Decimal64(Number.ConvertIntegerToDecimalIeee754<
Decimal64
, ulong, nint>(value));
417
/// <summary>Explicitly converts a <see cref="System.UIntPtr" /> value to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</summary>
419
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</returns>
421
public static explicit operator
Decimal64
(nuint value) => new Decimal64(Number.ConvertIntegerToDecimalIeee754<
Decimal64
, ulong, nuint>(value));
423
/// <summary>Explicitly converts a <see cref="long" /> value to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</summary>
425
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</returns>
426
public static explicit operator
Decimal64
(long value) => new Decimal64(Number.ConvertIntegerToDecimalIeee754<
Decimal64
, ulong, long>(value));
428
/// <summary>Explicitly converts a <see cref="ulong" /> value to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</summary>
430
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</returns>
432
public static explicit operator
Decimal64
(ulong value) => new Decimal64(Number.ConvertIntegerToDecimalIeee754<
Decimal64
, ulong, ulong>(value));
434
/// <summary>Explicitly converts a <see cref="System.Int128" /> value to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</summary>
436
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</returns>
437
public static explicit operator
Decimal64
(Int128 value) => new Decimal64(Number.ConvertIntegerToDecimalIeee754<
Decimal64
, ulong, Int128>(value));
439
/// <summary>Explicitly converts a <see cref="System.UInt128" /> value to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</summary>
441
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</returns>
443
public static explicit operator
Decimal64
(UInt128 value) => new Decimal64(Number.ConvertIntegerToDecimalIeee754<
Decimal64
, ulong, UInt128>(value));
445
/// <summary>Explicitly converts a <see cref="System.Half" /> value to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</summary>
447
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</returns>
448
public static explicit operator
Decimal64
(Half value) => new Decimal64(Number.ConvertFloatToDecimalIeee754<Half,
Decimal64
, ulong>(value));
450
/// <summary>Explicitly converts a <see cref="float" /> value to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</summary>
452
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</returns>
453
public static explicit operator
Decimal64
(float value) => new Decimal64(Number.ConvertFloatToDecimalIeee754<float,
Decimal64
, ulong>(value));
455
/// <summary>Explicitly converts a <see cref="double" /> value to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</summary>
457
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</returns>
458
public static explicit operator
Decimal64
(double value) => new Decimal64(Number.ConvertFloatToDecimalIeee754<double,
Decimal64
, ulong>(value));
460
/// <summary>Explicitly converts a <see cref="System.Numerics.Decimal128" /> value to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</summary>
462
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</returns>
463
public static explicit operator
Decimal64
(Decimal128 value) => new Decimal64(Number.ConvertDecimalIeee754<Decimal128, UInt128,
Decimal64
, ulong>(new UInt128(value._upper, value._lower)));
465
/// <summary>Explicitly converts a <see cref="decimal" /> value to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</summary>
467
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</returns>
468
public static explicit operator
Decimal64
(decimal value) => new Decimal64(Number.ConvertDecimalToDecimalIeee754<
Decimal64
, ulong>(value));
474
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="byte" /> value.</summary>
477
public static explicit operator byte(
Decimal64
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal64
, ulong, byte>(value._value, isChecked: false);
479
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="byte" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
483
public static explicit operator checked byte(
Decimal64
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal64
, ulong, byte>(value._value, isChecked: true);
485
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="sbyte" /> value.</summary>
489
public static explicit operator sbyte(
Decimal64
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal64
, ulong, sbyte>(value._value, isChecked: false);
491
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="sbyte" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
496
public static explicit operator checked sbyte(
Decimal64
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal64
, ulong, sbyte>(value._value, isChecked: true);
498
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="char" /> value.</summary>
501
public static explicit operator char(
Decimal64
value) => (char)Number.ConvertDecimalIeee754ToInteger<
Decimal64
, ulong, ushort>(value._value, isChecked: false);
503
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="char" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
507
public static explicit operator checked char(
Decimal64
value) => (char)Number.ConvertDecimalIeee754ToInteger<
Decimal64
, ulong, ushort>(value._value, isChecked: true);
509
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="short" /> value.</summary>
512
public static explicit operator short(
Decimal64
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal64
, ulong, short>(value._value, isChecked: false);
514
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="short" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
518
public static explicit operator checked short(
Decimal64
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal64
, ulong, short>(value._value, isChecked: true);
520
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="ushort" /> value.</summary>
524
public static explicit operator ushort(
Decimal64
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal64
, ulong, ushort>(value._value, isChecked: false);
526
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="ushort" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
531
public static explicit operator checked ushort(
Decimal64
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal64
, ulong, ushort>(value._value, isChecked: true);
533
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="int" /> value.</summary>
536
public static explicit operator int(
Decimal64
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal64
, ulong, int>(value._value, isChecked: false);
538
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="int" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
542
public static explicit operator checked int(
Decimal64
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal64
, ulong, int>(value._value, isChecked: true);
544
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="uint" /> value.</summary>
548
public static explicit operator uint(
Decimal64
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal64
, ulong, uint>(value._value, isChecked: false);
550
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="uint" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
555
public static explicit operator checked uint(
Decimal64
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal64
, ulong, uint>(value._value, isChecked: true);
557
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="System.IntPtr" /> value.</summary>
560
public static explicit operator nint(
Decimal64
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal64
, ulong, nint>(value._value, isChecked: false);
562
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="System.IntPtr" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
566
public static explicit operator checked nint(
Decimal64
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal64
, ulong, nint>(value._value, isChecked: true);
568
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="System.UIntPtr" /> value.</summary>
572
public static explicit operator nuint(
Decimal64
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal64
, ulong, nuint>(value._value, isChecked: false);
574
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="System.UIntPtr" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
579
public static explicit operator checked nuint(
Decimal64
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal64
, ulong, nuint>(value._value, isChecked: true);
581
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="long" /> value.</summary>
584
public static explicit operator long(
Decimal64
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal64
, ulong, long>(value._value, isChecked: false);
586
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="long" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
590
public static explicit operator checked long(
Decimal64
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal64
, ulong, long>(value._value, isChecked: true);
592
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="ulong" /> value.</summary>
596
public static explicit operator ulong(
Decimal64
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal64
, ulong, ulong>(value._value, isChecked: false);
598
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="ulong" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
603
public static explicit operator checked ulong(
Decimal64
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal64
, ulong, ulong>(value._value, isChecked: true);
605
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="System.Int128" /> value.</summary>
608
public static explicit operator Int128(
Decimal64
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal64
, ulong, Int128>(value._value, isChecked: false);
610
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="System.Int128" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
614
public static explicit operator checked Int128(
Decimal64
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal64
, ulong, Int128>(value._value, isChecked: true);
616
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="System.UInt128" /> value.</summary>
620
public static explicit operator UInt128(
Decimal64
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal64
, ulong, UInt128>(value._value, isChecked: false);
622
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="System.UInt128" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
627
public static explicit operator checked UInt128(
Decimal64
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal64
, ulong, UInt128>(value._value, isChecked: true);
629
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="System.Half" /> value.</summary>
632
public static explicit operator Half(
Decimal64
value) => Number.ConvertDecimalIeee754ToFloat<
Decimal64
, ulong, Half>(value._value);
634
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="float" /> value.</summary>
637
public static explicit operator float(
Decimal64
value) => Number.ConvertDecimalIeee754ToFloat<
Decimal64
, ulong, float>(value._value);
639
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="double" /> value.</summary>
642
public static explicit operator double(
Decimal64
value) => Number.ConvertDecimalIeee754ToFloat<
Decimal64
, ulong, double>(value._value);
644
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="decimal" /> value.</summary>
648
public static explicit operator decimal(
Decimal64
value) => Number.ConvertDecimalIeee754ToDecimal<
Decimal64
, ulong>(value._value);
654
/// <summary>Implicitly converts a <see cref="byte" /> value to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</summary>
656
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</returns>
657
public static implicit operator
Decimal64
(byte value) => new Decimal64(Number.ConvertIntegerToDecimalIeee754<
Decimal64
, ulong, byte>(value));
659
/// <summary>Implicitly converts a <see cref="sbyte" /> value to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</summary>
661
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</returns>
663
public static implicit operator
Decimal64
(sbyte value) => new Decimal64(Number.ConvertIntegerToDecimalIeee754<
Decimal64
, ulong, sbyte>(value));
665
/// <summary>Implicitly converts a <see cref="char" /> value to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</summary>
667
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</returns>
668
public static implicit operator
Decimal64
(char value) => new Decimal64(Number.ConvertIntegerToDecimalIeee754<
Decimal64
, ulong, ushort>(value));
670
/// <summary>Implicitly converts a <see cref="short" /> value to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</summary>
672
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</returns>
673
public static implicit operator
Decimal64
(short value) => new Decimal64(Number.ConvertIntegerToDecimalIeee754<
Decimal64
, ulong, short>(value));
675
/// <summary>Implicitly converts a <see cref="ushort" /> value to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</summary>
677
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</returns>
679
public static implicit operator
Decimal64
(ushort value) => new Decimal64(Number.ConvertIntegerToDecimalIeee754<
Decimal64
, ulong, ushort>(value));
681
/// <summary>Implicitly converts a <see cref="int" /> value to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</summary>
683
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</returns>
684
public static implicit operator
Decimal64
(int value) => new Decimal64(Number.ConvertIntegerToDecimalIeee754<
Decimal64
, ulong, int>(value));
686
/// <summary>Implicitly converts a <see cref="uint" /> value to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</summary>
688
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal64
" /> value.</returns>
690
public static implicit operator
Decimal64
(uint value) => new Decimal64(Number.ConvertIntegerToDecimalIeee754<
Decimal64
, ulong, uint>(value));
696
/// <summary>Implicitly converts a <see cref="System.Numerics.
Decimal64
" /> value to its nearest representable <see cref="System.Numerics.Decimal128" /> value.</summary>
699
public static implicit operator Decimal128(
Decimal64
value) => new Decimal128(Number.ConvertDecimalIeee754<
Decimal64
, ulong, Decimal128, UInt128>(value._value));
705
public static bool operator ==(
Decimal64
left,
Decimal64
right)
707
return Number.EqualsDecimalIeee754<
Decimal64
, ulong>(left._value, right._value);
714
public static bool operator !=(
Decimal64
left,
Decimal64
right)
723
public static bool operator <(
Decimal64
left,
Decimal64
right)
725
return Number.LessThanDecimalIeee754<
Decimal64
, ulong>(left._value, right._value);
732
public static bool operator >(
Decimal64
left,
Decimal64
right)
734
return Number.GreaterThanDecimalIeee754<
Decimal64
, ulong>(left._value, right._value);
741
public static bool operator <=(
Decimal64
left,
Decimal64
right)
743
return Number.LessThanOrEqualDecimalIeee754<
Decimal64
, ulong>(left._value, right._value);
750
public static bool operator >=(
Decimal64
left,
Decimal64
right)
752
return Number.GreaterThanOrEqualDecimalIeee754<
Decimal64
, ulong>(left._value, right._value);
760
public static bool TryParsePartial([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out
Decimal64
result, out int charsConsumed)
763
return Number.TryParseDecimalIeee754<char,
Decimal64
, ulong>(s.AsSpan(), style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) == Number.ParsingStatus.OK;
767
public static bool TryParsePartial(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider? provider, out
Decimal64
result, out int charsConsumed)
770
return Number.TryParseDecimalIeee754<char,
Decimal64
, ulong>(s, style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) == Number.ParsingStatus.OK;
774
public static bool TryParsePartial(ReadOnlySpan<byte> utf8Text, NumberStyles style, IFormatProvider? provider, out
Decimal64
result, out int bytesConsumed)
777
return Number.TryParseDecimalIeee754<byte,
Decimal64
, ulong>(utf8Text, style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out bytesConsumed) == Number.ParsingStatus.OK;
781
/// Tries to parse a <see cref="
Decimal64
"/> from a <see cref="ReadOnlySpan{Byte}"/> containing UTF-8 text in the default parse style.
784
/// <param name="result">The equivalent <see cref="
Decimal64
"/> value representing the input if the parse was successful. If the input exceeds Decimal64's range, a <see cref="PositiveInfinity"/> or <see cref="NegativeInfinity"/> is returned. If the parse was unsuccessful, a default <see cref="
Decimal64
"/> value is returned.</param>
786
public static bool TryParse(ReadOnlySpan<byte> utf8Text, out
Decimal64
result) => TryParse(utf8Text, provider: null, out result);
789
public static
Decimal64
Parse(ReadOnlySpan<byte> utf8Text, NumberStyles style = NumberStyles.Float | NumberStyles.AllowThousands, IFormatProvider? provider = null)
792
return Number.ParseDecimalIeee754<byte,
Decimal64
, ulong>(utf8Text, style, NumberFormatInfo.GetInstance(provider));
796
public static
Decimal64
Parse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider) => Parse(utf8Text, NumberStyles.Float | NumberStyles.AllowThousands, provider);
799
public static bool TryParse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider, [MaybeNullWhen(false)] out
Decimal64
result) => Number.TryParseDecimalIeee754<byte,
Decimal64
, ulong>(utf8Text, NumberStyles.Float | NumberStyles.AllowThousands, NumberFormatInfo.GetInstance(provider), out result, out _) == Number.ParsingStatus.OK;
802
public static
Decimal64
One => new Decimal64(OneValue);
805
public static
Decimal64
NegativeOne => new Decimal64(NegativeOneValue);
808
public static
Decimal64
E => new Decimal64(EValue);
811
public static
Decimal64
Pi => new Decimal64(PiValue);
814
public static
Decimal64
Tau => new Decimal64(TauValue);
821
public static
Decimal64
Ceiling(
Decimal64
x) => new Decimal64(Number.RoundDecimalIeee754<
Decimal64
, ulong>(x._value, 0, MidpointRounding.ToPositiveInfinity));
824
public static TInteger ConvertToInteger<TInteger>(
Decimal64
value)
828
public static TInteger ConvertToIntegerNative<TInteger>(
Decimal64
value)
832
public static
Decimal64
Floor(
Decimal64
x) => new Decimal64(Number.RoundDecimalIeee754<
Decimal64
, ulong>(x._value, 0, MidpointRounding.ToNegativeInfinity));
835
public static
Decimal64
Round(
Decimal64
x) => new Decimal64(Number.RoundDecimalIeee754<
Decimal64
, ulong>(x._value, 0, MidpointRounding.ToEven));
838
public static
Decimal64
Round(
Decimal64
x, int digits) => new Decimal64(Number.RoundDecimalIeee754<
Decimal64
, ulong>(x._value, digits, MidpointRounding.ToEven));
841
public static
Decimal64
Round(
Decimal64
x, MidpointRounding mode) => new Decimal64(Number.RoundDecimalIeee754<
Decimal64
, ulong>(x._value, 0, mode));
844
public static
Decimal64
Round(
Decimal64
x, int digits, MidpointRounding mode) => new Decimal64(Number.RoundDecimalIeee754<
Decimal64
, ulong>(x._value, digits, mode));
847
public static
Decimal64
Truncate(
Decimal64
x) => new Decimal64(Number.RoundDecimalIeee754<
Decimal64
, ulong>(x._value, 0, MidpointRounding.ToZero));
850
int IFloatingPoint<
Decimal64
>.GetExponentByteCount() => sizeof(int);
853
int IFloatingPoint<
Decimal64
>.GetExponentShortestBitLength()
855
int exponent = Number.UnpackDecimalIeee754<
Decimal64
, ulong>(_value).UnbiasedExponent;
868
int IFloatingPoint<
Decimal64
>.GetSignificandBitLength() => 54;
871
int IFloatingPoint<
Decimal64
>.GetSignificandByteCount() => sizeof(ulong);
874
bool IFloatingPoint<
Decimal64
>.TryWriteExponentBigEndian(Span<byte> destination, out int bytesWritten)
876
if (BinaryPrimitives.TryWriteInt32BigEndian(destination, Number.UnpackDecimalIeee754<
Decimal64
, ulong>(_value).UnbiasedExponent))
887
bool IFloatingPoint<
Decimal64
>.TryWriteExponentLittleEndian(Span<byte> destination, out int bytesWritten)
889
if (BinaryPrimitives.TryWriteInt32LittleEndian(destination, Number.UnpackDecimalIeee754<
Decimal64
, ulong>(_value).UnbiasedExponent))
900
bool IFloatingPoint<
Decimal64
>.TryWriteSignificandBigEndian(Span<byte> destination, out int bytesWritten)
902
if (BinaryPrimitives.TryWriteUInt64BigEndian(destination, Number.UnpackDecimalIeee754<
Decimal64
, ulong>(_value).Significand))
913
bool IFloatingPoint<
Decimal64
>.TryWriteSignificandLittleEndian(Span<byte> destination, out int bytesWritten)
915
if (BinaryPrimitives.TryWriteUInt64LittleEndian(destination, Number.UnpackDecimalIeee754<
Decimal64
, ulong>(_value).Significand))
930
public static
Decimal64
Acos(
Decimal64
x) => new Decimal64(Number.AcosDecimalIeee754<
Decimal64
, ulong>(x._value));
933
public static
Decimal64
AcosPi(
Decimal64
x) => new Decimal64(Number.AcosPiDecimalIeee754<
Decimal64
, ulong>(x._value));
936
public static
Decimal64
Acosh(
Decimal64
x) => new Decimal64(Number.AcoshDecimalIeee754<
Decimal64
, ulong>(x._value));
939
public static
Decimal64
Asin(
Decimal64
x) => new Decimal64(Number.AsinDecimalIeee754<
Decimal64
, ulong>(x._value));
942
public static
Decimal64
AsinPi(
Decimal64
x) => new Decimal64(Number.AsinPiDecimalIeee754<
Decimal64
, ulong>(x._value));
945
public static
Decimal64
Asinh(
Decimal64
x) => new Decimal64(Number.AsinhDecimalIeee754<
Decimal64
, ulong>(x._value));
948
public static
Decimal64
Atan(
Decimal64
x) => new Decimal64(Number.AtanDecimalIeee754<
Decimal64
, ulong>(x._value));
951
public static
Decimal64
Atan2(
Decimal64
y,
Decimal64
x) => new Decimal64(Number.Atan2DecimalIeee754<
Decimal64
, ulong>(y._value, x._value));
954
public static
Decimal64
Atan2Pi(
Decimal64
y,
Decimal64
x) => new Decimal64(Number.Atan2PiDecimalIeee754<
Decimal64
, ulong>(y._value, x._value));
957
public static
Decimal64
AtanPi(
Decimal64
x) => new Decimal64(Number.AtanPiDecimalIeee754<
Decimal64
, ulong>(x._value));
960
public static
Decimal64
Atanh(
Decimal64
x) => new Decimal64(Number.AtanhDecimalIeee754<
Decimal64
, ulong>(x._value));
963
public static
Decimal64
BitDecrement(
Decimal64
x) => new Decimal64(Number.BitDecrementDecimalIeee754<
Decimal64
, ulong>(x._value));
966
public static
Decimal64
BitIncrement(
Decimal64
x) => new Decimal64(Number.BitIncrementDecimalIeee754<
Decimal64
, ulong>(x._value));
969
public static
Decimal64
Cbrt(
Decimal64
x) => new Decimal64(Number.CbrtDecimalIeee754<
Decimal64
, ulong>(x._value));
972
public static
Decimal64
Cos(
Decimal64
x) => new Decimal64(Number.CosDecimalIeee754<
Decimal64
, ulong>(x._value));
975
public static
Decimal64
CosPi(
Decimal64
x) => new Decimal64(Number.CosPiDecimalIeee754<
Decimal64
, ulong>(x._value));
978
public static
Decimal64
Cosh(
Decimal64
x) => new Decimal64(Number.CoshDecimalIeee754<
Decimal64
, ulong>(x._value));
981
public static
Decimal64
DegreesToRadians(
Decimal64
degrees) => new Decimal64(Number.MultiplyByWideConstantDecimalIeee754<
Decimal64
, ulong>(degrees._value, DegreesToRadiansHead, DegreesToRadiansTail, DegreesToRadiansExponent));
984
public static
Decimal64
Exp(
Decimal64
x) => new Decimal64(Number.ExpDecimalIeee754<
Decimal64
, ulong>(x._value));
987
public static
Decimal64
Exp10(
Decimal64
x) => new Decimal64(Number.Exp10DecimalIeee754<
Decimal64
, ulong>(x._value));
990
public static
Decimal64
Exp10M1(
Decimal64
x) => new Decimal64(Number.Exp10M1DecimalIeee754<
Decimal64
, ulong>(x._value));
993
public static
Decimal64
Exp2(
Decimal64
x) => new Decimal64(Number.Exp2DecimalIeee754<
Decimal64
, ulong>(x._value));
996
public static
Decimal64
Exp2M1(
Decimal64
x) => new Decimal64(Number.Exp2M1DecimalIeee754<
Decimal64
, ulong>(x._value));
999
public static
Decimal64
ExpM1(
Decimal64
x) => new Decimal64(Number.ExpM1DecimalIeee754<
Decimal64
, ulong>(x._value));
1002
public static
Decimal64
FusedMultiplyAdd(
Decimal64
left,
Decimal64
right,
Decimal64
addend) => new Decimal64(Number.FusedMultiplyAddDecimalIeee754<
Decimal64
, ulong>(left._value, right._value, addend._value));
1005
public static
Decimal64
Hypot(
Decimal64
x,
Decimal64
y) => new Decimal64(Number.HypotDecimalIeee754<
Decimal64
, ulong>(x._value, y._value));
1008
public static
Decimal64
Ieee754Remainder(
Decimal64
left,
Decimal64
right) => new Decimal64(Number.Ieee754RemainderDecimalIeee754<
Decimal64
, ulong>(left._value, right._value));
1011
public static int ILogB(
Decimal64
x) => Number.ILogBDecimalIeee754<
Decimal64
, ulong>(x._value);
1014
public static
Decimal64
Lerp(
Decimal64
value1,
Decimal64
value2,
Decimal64
amount) => MultiplyAddEstimate(value1, One - amount, value2 * amount);
1017
public static
Decimal64
Log(
Decimal64
x) => new Decimal64(Number.LogDecimalIeee754<
Decimal64
, ulong>(x._value));
1020
public static
Decimal64
Log(
Decimal64
x,
Decimal64
newBase) => new Decimal64(Number.LogDecimalIeee754<
Decimal64
, ulong>(x._value, newBase._value));
1023
public static
Decimal64
Log10(
Decimal64
x) => new Decimal64(Number.Log10DecimalIeee754<
Decimal64
, ulong>(x._value));
1026
public static
Decimal64
Log10P1(
Decimal64
x) => new Decimal64(Number.Log10P1DecimalIeee754<
Decimal64
, ulong>(x._value));
1029
public static
Decimal64
Log2(
Decimal64
x) => new Decimal64(Number.Log2DecimalIeee754<
Decimal64
, ulong>(x._value));
1032
public static
Decimal64
Log2P1(
Decimal64
x) => new Decimal64(Number.Log2P1DecimalIeee754<
Decimal64
, ulong>(x._value));
1035
public static
Decimal64
LogP1(
Decimal64
x) => new Decimal64(Number.LogP1DecimalIeee754<
Decimal64
, ulong>(x._value));
1038
public static
Decimal64
Pow(
Decimal64
x,
Decimal64
y) => new Decimal64(Number.PowDecimalIeee754<
Decimal64
, ulong>(x._value, y._value));
1041
public static
Decimal64
RadiansToDegrees(
Decimal64
radians) => new Decimal64(Number.MultiplyByWideConstantDecimalIeee754<
Decimal64
, ulong>(radians._value, RadiansToDegreesHead, RadiansToDegreesTail, RadiansToDegreesExponent));
1044
public static
Decimal64
ReciprocalEstimate(
Decimal64
x) => One / x;
1047
public static
Decimal64
ReciprocalSqrtEstimate(
Decimal64
x) => One / Sqrt(x);
1050
public static
Decimal64
RootN(
Decimal64
x, int n) => new Decimal64(Number.RootNDecimalIeee754<
Decimal64
, ulong>(x._value, n));
1053
public static
Decimal64
ScaleB(
Decimal64
x, int n) => new Decimal64(Number.ScaleBDecimalIeee754<
Decimal64
, ulong>(x._value, n));
1056
public static
Decimal64
Sin(
Decimal64
x) => new Decimal64(Number.SinDecimalIeee754<
Decimal64
, ulong>(x._value));
1059
public static (
Decimal64
Sin,
Decimal64
Cos) SinCos(
Decimal64
x)
1061
(ulong sin, ulong cos) = Number.SinCosDecimalIeee754<
Decimal64
, ulong>(x._value);
1066
public static (
Decimal64
SinPi,
Decimal64
CosPi) SinCosPi(
Decimal64
x)
1068
(ulong sin, ulong cos) = Number.SinCosPiDecimalIeee754<
Decimal64
, ulong>(x._value);
1073
public static
Decimal64
SinPi(
Decimal64
x) => new Decimal64(Number.SinPiDecimalIeee754<
Decimal64
, ulong>(x._value));
1076
public static
Decimal64
Sinh(
Decimal64
x) => new Decimal64(Number.SinhDecimalIeee754<
Decimal64
, ulong>(x._value));
1079
public static
Decimal64
Sqrt(
Decimal64
x) => new Decimal64(Number.SqrtDecimalIeee754<
Decimal64
, ulong>(x._value));
1082
public static
Decimal64
Tan(
Decimal64
x) => new Decimal64(Number.TanDecimalIeee754<
Decimal64
, ulong>(x._value));
1085
public static
Decimal64
TanPi(
Decimal64
x) => new Decimal64(Number.TanPiDecimalIeee754<
Decimal64
, ulong>(x._value));
1088
public static
Decimal64
Tanh(
Decimal64
x) => new Decimal64(Number.TanhDecimalIeee754<
Decimal64
, ulong>(x._value));
1094
public static
Decimal64
Quantize(
Decimal64
x,
Decimal64
y) => new Decimal64(Number.QuantizeDecimalIeee754<
Decimal64
, ulong>(x._value, y._value));
1099
public static
Decimal64
GetQuantum(
Decimal64
x) => new Decimal64(Number.QuantumDecimalIeee754<
Decimal64
, ulong>(x._value));
1105
public static bool HaveSameQuantum(
Decimal64
x,
Decimal64
y) => Number.SameQuantumDecimalIeee754<
Decimal64
, ulong>(x._value, y._value);
1110
public static
Decimal64
Abs(
Decimal64
value) => new Decimal64(Number.AbsDecimalIeee754<
Decimal64
, ulong>(value._value));
1115
public static bool IsFinite(
Decimal64
value) => (value._value & InfinityMask) != InfinityMask;
1120
public static bool IsInfinity(
Decimal64
value) => (value._value & NaNMask) == InfinityMask;
1125
public static bool IsNaN(
Decimal64
value) => (value._value & NaNMask) == NaNMask;
1130
public static bool IsNegative(
Decimal64
value) => (value._value & SignMask) != 0;
1135
public static bool IsNegativeInfinity(
Decimal64
value) => (value._value & (SignMask | NaNMask)) == NegativeInfinityValue;
1140
public static bool IsPositive(
Decimal64
value) => (value._value & SignMask) == 0;
1145
public static bool IsPositiveInfinity(
Decimal64
value) => (value._value & (SignMask | NaNMask)) == PositiveInfinityValue;
1150
public static bool IsRealNumber(
Decimal64
value) => !IsNaN(value);
1155
public static bool IsInteger(
Decimal64
value) => Number.IsIntegerDecimalIeee754<
Decimal64
, ulong>(value._value);
1160
public static bool IsEvenInteger(
Decimal64
value) => Number.IsEvenIntegerDecimalIeee754<
Decimal64
, ulong>(value._value);
1165
public static bool IsOddInteger(
Decimal64
value) => Number.IsOddIntegerDecimalIeee754<
Decimal64
, ulong>(value._value);
1170
public static bool IsNormal(
Decimal64
value) => Number.IsNormalDecimalIeee754<
Decimal64
, ulong>(value._value);
1175
public static bool IsSubnormal(
Decimal64
value) => Number.IsSubnormalDecimalIeee754<
Decimal64
, ulong>(value._value);
1181
public static
Decimal64
MaxMagnitude(
Decimal64
x,
Decimal64
y) => new Decimal64(Number.MaxMagnitudeDecimalIeee754<
Decimal64
, ulong>(x._value, y._value));
1187
public static
Decimal64
MaxMagnitudeNumber(
Decimal64
x,
Decimal64
y) => new Decimal64(Number.MaxMagnitudeNumberDecimalIeee754<
Decimal64
, ulong>(x._value, y._value));
1193
public static
Decimal64
MinMagnitude(
Decimal64
x,
Decimal64
y) => new Decimal64(Number.MinMagnitudeDecimalIeee754<
Decimal64
, ulong>(x._value, y._value));
1199
public static
Decimal64
MinMagnitudeNumber(
Decimal64
x,
Decimal64
y) => new Decimal64(Number.MinMagnitudeNumberDecimalIeee754<
Decimal64
, ulong>(x._value, y._value));
1206
public static
Decimal64
MultiplyAddEstimate(
Decimal64
left,
Decimal64
right,
Decimal64
addend) => (left * right) + addend;
1214
public static
Decimal64
Clamp(
Decimal64
value,
Decimal64
min,
Decimal64
max)
1229
public static
Decimal64
ClampNative(
Decimal64
value,
Decimal64
min,
Decimal64
max)
1242
public static
Decimal64
CopySign(
Decimal64
value,
Decimal64
sign) => new Decimal64(Number.CopySignDecimalIeee754<
Decimal64
, ulong>(value._value, sign._value));
1248
public static
Decimal64
Max(
Decimal64
x,
Decimal64
y) => new Decimal64(Number.MaxDecimalIeee754<
Decimal64
, ulong>(x._value, y._value));
1254
public static
Decimal64
MaxNative(
Decimal64
x,
Decimal64
y) => new Decimal64(Number.MaxNativeDecimalIeee754<
Decimal64
, ulong>(x._value, y._value));
1260
public static
Decimal64
MaxNumber(
Decimal64
x,
Decimal64
y) => new Decimal64(Number.MaxNumberDecimalIeee754<
Decimal64
, ulong>(x._value, y._value));
1266
public static
Decimal64
Min(
Decimal64
x,
Decimal64
y) => new Decimal64(Number.MinDecimalIeee754<
Decimal64
, ulong>(x._value, y._value));
1272
public static
Decimal64
MinNative(
Decimal64
x,
Decimal64
y) => new Decimal64(Number.MinNativeDecimalIeee754<
Decimal64
, ulong>(x._value, y._value));
1278
public static
Decimal64
MinNumber(
Decimal64
x,
Decimal64
y) => new Decimal64(Number.MinNumberDecimalIeee754<
Decimal64
, ulong>(x._value, y._value));
1284
public static int Sign(
Decimal64
value) => Number.SignDecimalIeee754<
Decimal64
, ulong>(value._value);
1287
static int INumberBase<
Decimal64
>.Radix => 10;
1290
static bool INumberBase<
Decimal64
>.IsCanonical(
Decimal64
value) => Number.IsCanonicalDecimalIeee754<
Decimal64
, ulong>(value._value, nanReservedMask: 0x01FC_0000_0000_0000, nanPayloadMask: NaNPayloadMask, maxNaNPayload: 999_999_999_999_999);
1293
static bool INumberBase<
Decimal64
>.IsComplexNumber(
Decimal64
value) => false;
1296
static bool INumberBase<
Decimal64
>.IsImaginaryNumber(
Decimal64
value) => false;
1299
static bool INumberBase<
Decimal64
>.IsZero(
Decimal64
value) => Number.IsZeroDecimalIeee754<
Decimal64
, ulong>(value._value);
1302
static
Decimal64
IAdditiveIdentity<
Decimal64
,
Decimal64
>.AdditiveIdentity => Zero;
1305
static
Decimal64
IMultiplicativeIdentity<
Decimal64
,
Decimal64
>.MultiplicativeIdentity => One;
1309
public static
Decimal64
CreateChecked<TOther>(TOther value)
1312
Decimal64
result;
1314
if (typeof(TOther) == typeof(
Decimal64
))
1316
result = (
Decimal64
)(object)value;
1328
public static
Decimal64
CreateSaturating<TOther>(TOther value)
1331
Decimal64
result;
1333
if (typeof(TOther) == typeof(
Decimal64
))
1335
result = (
Decimal64
)(object)value;
1347
public static
Decimal64
CreateTruncating<TOther>(TOther value)
1350
Decimal64
result;
1352
if (typeof(TOther) == typeof(
Decimal64
))
1354
result = (
Decimal64
)(object)value;
1366
static bool INumberBase<
Decimal64
>.TryConvertFromChecked<TOther>(TOther value, out
Decimal64
result) => TryConvertFrom(value, out result);
1370
static bool INumberBase<
Decimal64
>.TryConvertFromSaturating<TOther>(TOther value, out
Decimal64
result) => TryConvertFrom(value, out result);
1374
static bool INumberBase<
Decimal64
>.TryConvertFromTruncating<TOther>(TOther value, out
Decimal64
result) => TryConvertFrom(value, out result);
1377
private static bool TryConvertFrom<TOther>(TOther value, out
Decimal64
result)
1421
result = (
Decimal64
)(long)(object)value;
1426
result = (
Decimal64
)(ulong)(object)value;
1431
result = (
Decimal64
)(Int128)(object)value;
1436
result = (
Decimal64
)(UInt128)(object)value;
1441
result = (
Decimal64
)(nint)(object)value;
1446
result = (
Decimal64
)(nuint)(object)value;
1451
result = (
Decimal64
)(Half)(object)value;
1456
result = (
Decimal64
)(float)(object)value;
1461
result = (
Decimal64
)(double)(object)value;
1466
result = (
Decimal64
)(decimal)(object)value;
1476
result = (
Decimal64
)(Decimal128)(object)value;
1488
static bool INumberBase<
Decimal64
>.TryConvertToChecked<TOther>(
Decimal64
value, [MaybeNullWhen(false)] out TOther result)
1611
static bool INumberBase<
Decimal64
>.TryConvertToSaturating<TOther>(
Decimal64
value, [MaybeNullWhen(false)] out TOther result) => TryConvertTo(value, out result);
1615
static bool INumberBase<
Decimal64
>.TryConvertToTruncating<TOther>(
Decimal64
value, [MaybeNullWhen(false)] out TOther result) => TryConvertTo(value, out result);
1618
private static bool TryConvertTo<TOther>(
Decimal64
value, [MaybeNullWhen(false)] out TOther result)
1737
static int IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.Precision => Precision;
1739
static int IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.BufferLength => Number.Decimal64NumberBufferLength;
1741
static string IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.ToDecStr(ulong significand)
1746
static unsafe ulong IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.NumberToSignificand(ref Number.NumberBuffer number, int digits)
1751
static
Decimal64
IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.Construct(ulong value) => new Decimal64(value);
1753
static int IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.ConvertToExponent(ulong value) => (int)value;
1755
static ulong IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.Power10(int exponent) => UInt64Powers10[exponent];
1757
static (ulong Quotient, ulong Remainder) IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.DivRemPow10(ulong value, int exponent)
1763
static int IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.CountDigits(ulong significand) => FormattingHelpers.CountDigits(significand);
1765
static int IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.MaxExponent => MaxExponent;
1767
static int IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.MinExponent => MinExponent;
1769
static int IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.MaxAdjustedExponent => MaxExponent - Precision + 1;
1771
static int IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.MinAdjustedExponent => MinExponent - Precision + 1;
1773
static ulong IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.PositiveInfinity => PositiveInfinityValue;
1775
static ulong IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.NegativeInfinity => NegativeInfinityValue;
1777
static ulong IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.Zero => ZeroValue;
1779
static ulong IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.NaN => QuietNaNValue;
1781
static ulong IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.MostSignificantBitOfSignificandMask => MostSignificantBitOfSignificandMask;
1783
static ulong IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.NaNMask => NaNMask;
1785
static ulong IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.SNaNMask => SNaNMask;
1787
static ulong IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.NaNPayloadMask => NaNPayloadMask;
1789
static ulong IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.SignMask => SignMask;
1791
static ulong IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.G0G1Mask => G0G1Mask;
1793
static int IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.ExponentBias => ExponentBias;
1795
static int IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.NumberBitsSignificand => 50;
1797
static ulong IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.G0ToGwPlus1ExponentMask => 0x7FE0_0000_0000_0000;
1799
static ulong IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.G2ToGwPlus3ExponentMask => 0x1FF8_0000_0000_0000;
1801
static ulong IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.GwPlus2ToGwPlus4SignificandMask => 0x001F_FFFF_FFFF_FFFF;
1803
static ulong IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.GwPlus4SignificandMask => 0x0007_FFFF_FFFF_FFFF;
1805
static ulong IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.MaxSignificand => MaxSignificand;
1807
static bool IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.IsNaN(ulong decimalBits) => IsNaN(new Decimal64(decimalBits));
1809
static bool IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.IsNegative(ulong decimalBits) => IsNegative(new Decimal64(decimalBits));
1811
static bool IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.IsFinite(ulong decimalBits) => IsFinite(new Decimal64(decimalBits));
1813
static bool IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.IsInfinity(ulong decimalBits) => IsInfinity(new Decimal64(decimalBits));
1815
static bool IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.IsPositiveInfinity(ulong decimalBits) => IsPositiveInfinity(new Decimal64(decimalBits));
1817
static bool IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.IsNegativeInfinity(ulong decimalBits) => IsNegativeInfinity(new Decimal64(decimalBits));
1819
static ulong IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.EncodeExponentToG0ThroughGwPlus1(uint biasedExponent)
1824
static ulong IDecimalIeee754ParseAndFormatInfo<
Decimal64
, ulong>.EncodeExponentToG2ThroughGwPlus3(uint biasedExponent)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\TotalOrderIeee754Comparer.cs (4)
78
else if (typeof(T) == typeof(
Decimal64
))
80
return CompareDecimal<
Decimal64
, ulong>(((
Decimal64
)(object)x!)._value, ((
Decimal64
)(object)y!)._value);
System.Runtime (1)
src\runtime\artifacts\obj\System.Runtime\Release\net11.0\System.Runtime.Forwards.cs (1)
380
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.
Decimal64
))]
System.Text.Json (6)
System\Text\Json\Nodes\JsonValueOfT.cs (1)
109
type == typeof(System.Numerics.
Decimal64
) || type == typeof(System.Numerics.Decimal128))
System\Text\Json\Serialization\Converters\Value\JsonPrimitiveConverter.cs (1)
40
typeof(T) == typeof(System.Numerics.
Decimal64
) || typeof(T) == typeof(System.Numerics.Decimal128)));
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Converters.cs (3)
194
/// Returns a <see cref="JsonConverter{T}"/> instance that converts <see cref="System.Numerics.
Decimal64
"/> values.
197
public static JsonConverter<System.Numerics.
Decimal64
> Decimal64Converter =>
198
field ??= new Ieee754FloatingPointConverter<System.Numerics.
Decimal64
>(NumericType.Decimal64);
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (1)
731
potentialNumberType == typeof(System.Numerics.
Decimal64
) ||