119 instantiations of Decimal32
System.Private.CoreLib (119)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal32.cs (119)
77
public static Decimal32 PositiveInfinity => new
Decimal32
(PositiveInfinityValue);
80
public static Decimal32 NegativeInfinity => new
Decimal32
(NegativeInfinityValue);
83
public static Decimal32 NaN => new
Decimal32
(QuietNaNValue);
86
public static Decimal32 NegativeZero => new
Decimal32
(NegativeZeroValue);
89
public static Decimal32 Zero => new
Decimal32
(ZeroValue);
92
public static Decimal32 MinValue => new
Decimal32
(MinInternalValue);
95
public static Decimal32 MaxValue => new
Decimal32
(MaxInternalValue);
98
public static Decimal32 Epsilon => new
Decimal32
(0x0000_0001); // Smallest positive subnormal value, aka 1 * 10^-101
276
public static Decimal32 DecodeBinary(uint x) => new
Decimal32
(x);
288
public static Decimal32 DecodeDecimal(uint x) => new
Decimal32
(Number.DecodeDecimalIeee754<Decimal32, uint>(x));
342
public static Decimal32 operator -(Decimal32 value) => new
Decimal32
(value._value ^ SignMask);
349
return new
Decimal32
(Number.AddDecimalIeee754<Decimal32, uint>(value._value, OneValue));
357
return new
Decimal32
(Number.SubtractDecimalIeee754<Decimal32, uint>(value._value, OneValue));
366
return new
Decimal32
(Number.AddDecimalIeee754<Decimal32, uint>(left._value, right._value));
375
return new
Decimal32
(Number.SubtractDecimalIeee754<Decimal32, uint>(left._value, right._value));
384
return new
Decimal32
(Number.MultiplyDecimalIeee754<Decimal32, uint>(left._value, right._value));
393
return new
Decimal32
(Number.DivideDecimalIeee754<Decimal32, uint>(left._value, right._value));
402
return new
Decimal32
(Number.RemainderDecimalIeee754<Decimal32, uint>(left._value, right._value));
412
public static explicit operator Decimal32(int value) => new
Decimal32
(Number.ConvertIntegerToDecimalIeee754<Decimal32, uint, int>(value));
418
public static explicit operator Decimal32(uint value) => new
Decimal32
(Number.ConvertIntegerToDecimalIeee754<Decimal32, uint, uint>(value));
423
public static explicit operator Decimal32(nint value) => new
Decimal32
(Number.ConvertIntegerToDecimalIeee754<Decimal32, uint, nint>(value));
429
public static explicit operator Decimal32(nuint value) => new
Decimal32
(Number.ConvertIntegerToDecimalIeee754<Decimal32, uint, nuint>(value));
434
public static explicit operator Decimal32(long value) => new
Decimal32
(Number.ConvertIntegerToDecimalIeee754<Decimal32, uint, long>(value));
440
public static explicit operator Decimal32(ulong value) => new
Decimal32
(Number.ConvertIntegerToDecimalIeee754<Decimal32, uint, ulong>(value));
445
public static explicit operator Decimal32(Int128 value) => new
Decimal32
(Number.ConvertIntegerToDecimalIeee754<Decimal32, uint, Int128>(value));
451
public static explicit operator Decimal32(UInt128 value) => new
Decimal32
(Number.ConvertIntegerToDecimalIeee754<Decimal32, uint, UInt128>(value));
456
public static explicit operator Decimal32(Half value) => new
Decimal32
(Number.ConvertFloatToDecimalIeee754<Half, Decimal32, uint>(value));
461
public static explicit operator Decimal32(float value) => new
Decimal32
(Number.ConvertFloatToDecimalIeee754<float, Decimal32, uint>(value));
466
public static explicit operator Decimal32(double value) => new
Decimal32
(Number.ConvertFloatToDecimalIeee754<double, Decimal32, uint>(value));
471
public static explicit operator Decimal32(Decimal64 value) => new
Decimal32
(Number.ConvertDecimalIeee754<Decimal64, ulong, Decimal32, uint>(value._value));
476
public static explicit operator Decimal32(Decimal128 value) => new
Decimal32
(Number.ConvertDecimalIeee754<Decimal128, UInt128, Decimal32, uint>(new UInt128(value._upper, value._lower)));
481
public static explicit operator Decimal32(decimal value) => new
Decimal32
(Number.ConvertDecimalToDecimalIeee754<Decimal32, uint>(value));
670
public static implicit operator Decimal32(byte value) => new
Decimal32
(Number.ConvertIntegerToDecimalIeee754<Decimal32, uint, byte>(value));
676
public static implicit operator Decimal32(sbyte value) => new
Decimal32
(Number.ConvertIntegerToDecimalIeee754<Decimal32, uint, sbyte>(value));
681
public static implicit operator Decimal32(char value) => new
Decimal32
(Number.ConvertIntegerToDecimalIeee754<Decimal32, uint, ushort>(value));
686
public static implicit operator Decimal32(short value) => new
Decimal32
(Number.ConvertIntegerToDecimalIeee754<Decimal32, uint, short>(value));
692
public static implicit operator Decimal32(ushort value) => new
Decimal32
(Number.ConvertIntegerToDecimalIeee754<Decimal32, uint, ushort>(value));
809
public static Decimal32 One => new
Decimal32
(OneValue);
812
public static Decimal32 NegativeOne => new
Decimal32
(NegativeOneValue);
815
public static Decimal32 E => new
Decimal32
(EValue);
818
public static Decimal32 Pi => new
Decimal32
(PiValue);
821
public static Decimal32 Tau => new
Decimal32
(TauValue);
828
public static Decimal32 Ceiling(Decimal32 x) => new
Decimal32
(Number.RoundDecimalIeee754<Decimal32, uint>(x._value, 0, MidpointRounding.ToPositiveInfinity));
839
public static Decimal32 Floor(Decimal32 x) => new
Decimal32
(Number.RoundDecimalIeee754<Decimal32, uint>(x._value, 0, MidpointRounding.ToNegativeInfinity));
842
public static Decimal32 Round(Decimal32 x) => new
Decimal32
(Number.RoundDecimalIeee754<Decimal32, uint>(x._value, 0, MidpointRounding.ToEven));
845
public static Decimal32 Round(Decimal32 x, int digits) => new
Decimal32
(Number.RoundDecimalIeee754<Decimal32, uint>(x._value, digits, MidpointRounding.ToEven));
848
public static Decimal32 Round(Decimal32 x, MidpointRounding mode) => new
Decimal32
(Number.RoundDecimalIeee754<Decimal32, uint>(x._value, 0, mode));
851
public static Decimal32 Round(Decimal32 x, int digits, MidpointRounding mode) => new
Decimal32
(Number.RoundDecimalIeee754<Decimal32, uint>(x._value, digits, mode));
854
public static Decimal32 Truncate(Decimal32 x) => new
Decimal32
(Number.RoundDecimalIeee754<Decimal32, uint>(x._value, 0, MidpointRounding.ToZero));
937
public static Decimal32 Acos(Decimal32 x) => new
Decimal32
(Number.AcosDecimalIeee754<Decimal32, uint>(x._value));
940
public static Decimal32 AcosPi(Decimal32 x) => new
Decimal32
(Number.AcosPiDecimalIeee754<Decimal32, uint>(x._value));
943
public static Decimal32 Acosh(Decimal32 x) => new
Decimal32
(Number.AcoshDecimalIeee754<Decimal32, uint>(x._value));
946
public static Decimal32 Asin(Decimal32 x) => new
Decimal32
(Number.AsinDecimalIeee754<Decimal32, uint>(x._value));
949
public static Decimal32 AsinPi(Decimal32 x) => new
Decimal32
(Number.AsinPiDecimalIeee754<Decimal32, uint>(x._value));
952
public static Decimal32 Asinh(Decimal32 x) => new
Decimal32
(Number.AsinhDecimalIeee754<Decimal32, uint>(x._value));
955
public static Decimal32 Atan(Decimal32 x) => new
Decimal32
(Number.AtanDecimalIeee754<Decimal32, uint>(x._value));
958
public static Decimal32 Atan2(Decimal32 y, Decimal32 x) => new
Decimal32
(Number.Atan2DecimalIeee754<Decimal32, uint>(y._value, x._value));
961
public static Decimal32 Atan2Pi(Decimal32 y, Decimal32 x) => new
Decimal32
(Number.Atan2PiDecimalIeee754<Decimal32, uint>(y._value, x._value));
964
public static Decimal32 AtanPi(Decimal32 x) => new
Decimal32
(Number.AtanPiDecimalIeee754<Decimal32, uint>(x._value));
967
public static Decimal32 Atanh(Decimal32 x) => new
Decimal32
(Number.AtanhDecimalIeee754<Decimal32, uint>(x._value));
970
public static Decimal32 BitDecrement(Decimal32 x) => new
Decimal32
(Number.BitDecrementDecimalIeee754<Decimal32, uint>(x._value));
973
public static Decimal32 BitIncrement(Decimal32 x) => new
Decimal32
(Number.BitIncrementDecimalIeee754<Decimal32, uint>(x._value));
976
public static Decimal32 Cbrt(Decimal32 x) => new
Decimal32
(Number.CbrtDecimalIeee754<Decimal32, uint>(x._value));
979
public static Decimal32 Cos(Decimal32 x) => new
Decimal32
(Number.CosDecimalIeee754<Decimal32, uint>(x._value));
982
public static Decimal32 CosPi(Decimal32 x) => new
Decimal32
(Number.CosPiDecimalIeee754<Decimal32, uint>(x._value));
985
public static Decimal32 Cosh(Decimal32 x) => new
Decimal32
(Number.CoshDecimalIeee754<Decimal32, uint>(x._value));
988
public static Decimal32 DegreesToRadians(Decimal32 degrees) => new
Decimal32
(Number.MultiplyByWideConstantDecimalIeee754<Decimal32, uint>(degrees._value, DegreesToRadiansHead, DegreesToRadiansTail, DegreesToRadiansExponent));
991
public static Decimal32 Exp(Decimal32 x) => new
Decimal32
(Number.ExpDecimalIeee754<Decimal32, uint>(x._value));
994
public static Decimal32 Exp10(Decimal32 x) => new
Decimal32
(Number.Exp10DecimalIeee754<Decimal32, uint>(x._value));
997
public static Decimal32 Exp10M1(Decimal32 x) => new
Decimal32
(Number.Exp10M1DecimalIeee754<Decimal32, uint>(x._value));
1000
public static Decimal32 Exp2(Decimal32 x) => new
Decimal32
(Number.Exp2DecimalIeee754<Decimal32, uint>(x._value));
1003
public static Decimal32 Exp2M1(Decimal32 x) => new
Decimal32
(Number.Exp2M1DecimalIeee754<Decimal32, uint>(x._value));
1006
public static Decimal32 ExpM1(Decimal32 x) => new
Decimal32
(Number.ExpM1DecimalIeee754<Decimal32, uint>(x._value));
1009
public static Decimal32 FusedMultiplyAdd(Decimal32 left, Decimal32 right, Decimal32 addend) => new
Decimal32
(Number.FusedMultiplyAddDecimalIeee754<Decimal32, uint>(left._value, right._value, addend._value));
1012
public static Decimal32 Hypot(Decimal32 x, Decimal32 y) => new
Decimal32
(Number.HypotDecimalIeee754<Decimal32, uint>(x._value, y._value));
1015
public static Decimal32 Ieee754Remainder(Decimal32 left, Decimal32 right) => new
Decimal32
(Number.Ieee754RemainderDecimalIeee754<Decimal32, uint>(left._value, right._value));
1024
public static Decimal32 Log(Decimal32 x) => new
Decimal32
(Number.LogDecimalIeee754<Decimal32, uint>(x._value));
1027
public static Decimal32 Log(Decimal32 x, Decimal32 newBase) => new
Decimal32
(Number.LogDecimalIeee754<Decimal32, uint>(x._value, newBase._value));
1030
public static Decimal32 Log10(Decimal32 x) => new
Decimal32
(Number.Log10DecimalIeee754<Decimal32, uint>(x._value));
1033
public static Decimal32 Log10P1(Decimal32 x) => new
Decimal32
(Number.Log10P1DecimalIeee754<Decimal32, uint>(x._value));
1036
public static Decimal32 Log2(Decimal32 x) => new
Decimal32
(Number.Log2DecimalIeee754<Decimal32, uint>(x._value));
1039
public static Decimal32 Log2P1(Decimal32 x) => new
Decimal32
(Number.Log2P1DecimalIeee754<Decimal32, uint>(x._value));
1042
public static Decimal32 LogP1(Decimal32 x) => new
Decimal32
(Number.LogP1DecimalIeee754<Decimal32, uint>(x._value));
1045
public static Decimal32 Pow(Decimal32 x, Decimal32 y) => new
Decimal32
(Number.PowDecimalIeee754<Decimal32, uint>(x._value, y._value));
1048
public static Decimal32 RadiansToDegrees(Decimal32 radians) => new
Decimal32
(Number.MultiplyByWideConstantDecimalIeee754<Decimal32, uint>(radians._value, RadiansToDegreesHead, RadiansToDegreesTail, RadiansToDegreesExponent));
1057
public static Decimal32 RootN(Decimal32 x, int n) => new
Decimal32
(Number.RootNDecimalIeee754<Decimal32, uint>(x._value, n));
1060
public static Decimal32 ScaleB(Decimal32 x, int n) => new
Decimal32
(Number.ScaleBDecimalIeee754<Decimal32, uint>(x._value, n));
1063
public static Decimal32 Sin(Decimal32 x) => new
Decimal32
(Number.SinDecimalIeee754<Decimal32, uint>(x._value));
1069
return (new
Decimal32
(sin), new
Decimal32
(cos));
1076
return (new
Decimal32
(sin), new
Decimal32
(cos));
1080
public static Decimal32 SinPi(Decimal32 x) => new
Decimal32
(Number.SinPiDecimalIeee754<Decimal32, uint>(x._value));
1083
public static Decimal32 Sinh(Decimal32 x) => new
Decimal32
(Number.SinhDecimalIeee754<Decimal32, uint>(x._value));
1086
public static Decimal32 Sqrt(Decimal32 x) => new
Decimal32
(Number.SqrtDecimalIeee754<Decimal32, uint>(x._value));
1089
public static Decimal32 Tan(Decimal32 x) => new
Decimal32
(Number.TanDecimalIeee754<Decimal32, uint>(x._value));
1092
public static Decimal32 TanPi(Decimal32 x) => new
Decimal32
(Number.TanPiDecimalIeee754<Decimal32, uint>(x._value));
1095
public static Decimal32 Tanh(Decimal32 x) => new
Decimal32
(Number.TanhDecimalIeee754<Decimal32, uint>(x._value));
1101
public static Decimal32 Quantize(Decimal32 x, Decimal32 y) => new
Decimal32
(Number.QuantizeDecimalIeee754<Decimal32, uint>(x._value, y._value));
1106
public static Decimal32 GetQuantum(Decimal32 x) => new
Decimal32
(Number.QuantumDecimalIeee754<Decimal32, uint>(x._value));
1117
public static Decimal32 Abs(Decimal32 value) => new
Decimal32
(Number.AbsDecimalIeee754<Decimal32, uint>(value._value));
1188
public static Decimal32 MaxMagnitude(Decimal32 x, Decimal32 y) => new
Decimal32
(Number.MaxMagnitudeDecimalIeee754<Decimal32, uint>(x._value, y._value));
1194
public static Decimal32 MaxMagnitudeNumber(Decimal32 x, Decimal32 y) => new
Decimal32
(Number.MaxMagnitudeNumberDecimalIeee754<Decimal32, uint>(x._value, y._value));
1200
public static Decimal32 MinMagnitude(Decimal32 x, Decimal32 y) => new
Decimal32
(Number.MinMagnitudeDecimalIeee754<Decimal32, uint>(x._value, y._value));
1206
public static Decimal32 MinMagnitudeNumber(Decimal32 x, Decimal32 y) => new
Decimal32
(Number.MinMagnitudeNumberDecimalIeee754<Decimal32, uint>(x._value, y._value));
1249
public static Decimal32 CopySign(Decimal32 value, Decimal32 sign) => new
Decimal32
(Number.CopySignDecimalIeee754<Decimal32, uint>(value._value, sign._value));
1255
public static Decimal32 Max(Decimal32 x, Decimal32 y) => new
Decimal32
(Number.MaxDecimalIeee754<Decimal32, uint>(x._value, y._value));
1261
public static Decimal32 MaxNative(Decimal32 x, Decimal32 y) => new
Decimal32
(Number.MaxNativeDecimalIeee754<Decimal32, uint>(x._value, y._value));
1267
public static Decimal32 MaxNumber(Decimal32 x, Decimal32 y) => new
Decimal32
(Number.MaxNumberDecimalIeee754<Decimal32, uint>(x._value, y._value));
1273
public static Decimal32 Min(Decimal32 x, Decimal32 y) => new
Decimal32
(Number.MinDecimalIeee754<Decimal32, uint>(x._value, y._value));
1279
public static Decimal32 MinNative(Decimal32 x, Decimal32 y) => new
Decimal32
(Number.MinNativeDecimalIeee754<Decimal32, uint>(x._value, y._value));
1285
public static Decimal32 MinNumber(Decimal32 x, Decimal32 y) => new
Decimal32
(Number.MinNumberDecimalIeee754<Decimal32, uint>(x._value, y._value));
1758
static Decimal32 IDecimalIeee754ParseAndFormatInfo<Decimal32, uint>.Construct(uint value) => new
Decimal32
(value);
1813
static bool IDecimalIeee754ParseAndFormatInfo<Decimal32, uint>.IsNaN(uint decimalBits) => IsNaN(new
Decimal32
(decimalBits));
1815
static bool IDecimalIeee754ParseAndFormatInfo<Decimal32, uint>.IsNegative(uint decimalBits) => IsNegative(new
Decimal32
(decimalBits));
1817
static bool IDecimalIeee754ParseAndFormatInfo<Decimal32, uint>.IsFinite(uint decimalBits) => IsFinite(new
Decimal32
(decimalBits));
1819
static bool IDecimalIeee754ParseAndFormatInfo<Decimal32, uint>.IsInfinity(uint decimalBits) => IsInfinity(new
Decimal32
(decimalBits));
1821
static bool IDecimalIeee754ParseAndFormatInfo<Decimal32, uint>.IsPositiveInfinity(uint decimalBits) => IsPositiveInfinity(new
Decimal32
(decimalBits));
1823
static bool IDecimalIeee754ParseAndFormatInfo<Decimal32, uint>.IsNegativeInfinity(uint decimalBits) => IsNegativeInfinity(new
Decimal32
(decimalBits));
719 references to Decimal32
System.Private.CoreLib (712)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal128.cs (6)
1465
else if (typeof(TOther) == typeof(
Decimal32
))
1467
result = (
Decimal32
)(object)value;
1588
else if (typeof(TOther) == typeof(
Decimal32
))
1590
result = (TOther)(object)(
Decimal32
)value;
1710
else if (typeof(TOther) == typeof(
Decimal32
))
1712
result = (TOther)(object)(
Decimal32
)value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal32.cs (696)
21
IComparable<
Decimal32
>,
22
IEquatable<
Decimal32
>,
23
IDecimalFloatingPointIeee754<
Decimal32
>,
25
ISpanParsable<
Decimal32
>,
26
IMinMaxValue<
Decimal32
>,
28
IUtf8SpanParsable<
Decimal32
>,
29
IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>
77
public static
Decimal32
PositiveInfinity => new Decimal32(PositiveInfinityValue);
80
public static
Decimal32
NegativeInfinity => new Decimal32(NegativeInfinityValue);
83
public static
Decimal32
NaN => new Decimal32(QuietNaNValue);
86
public static
Decimal32
NegativeZero => new Decimal32(NegativeZeroValue);
89
public static
Decimal32
Zero => new Decimal32(ZeroValue);
92
public static
Decimal32
MinValue => new Decimal32(MinInternalValue);
95
public static
Decimal32
MaxValue => new Decimal32(MaxInternalValue);
98
public static
Decimal32
Epsilon => new Decimal32(0x0000_0001); // Smallest positive subnormal value, aka 1 * 10^-101
112
/// Parses a <see cref="
Decimal32
"/> from a <see cref="string"/> in the default parse style.
115
/// <returns>The equivalent <see cref="
Decimal32
"/> value representing the input string. If the input exceeds Decimal32's range, a <see cref="PositiveInfinity"/> or <see cref="NegativeInfinity"/> is returned. </returns>
116
public static
Decimal32
Parse(string s) => Parse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider: null);
119
/// Parses a <see cref="
Decimal32
"/> from a <see cref="string"/> in the given <see cref="NumberStyles"/>.
123
/// <returns>The equivalent <see cref="
Decimal32
"/> value representing the input string. If the input exceeds Decimal32's range, a <see cref="PositiveInfinity"/> or <see cref="NegativeInfinity"/> is returned. </returns>
124
public static
Decimal32
Parse(string s, NumberStyles style) => Parse(s, style, provider: null);
127
public static
Decimal32
Parse(ReadOnlySpan<char> s, IFormatProvider? provider) => Parse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider);
130
/// Parses a <see cref="
Decimal32
"/> from a <see cref="string"/> and <see cref="IFormatProvider"/>.
134
/// <returns>The equivalent <see cref="
Decimal32
"/> value representing the input string. If the input exceeds Decimal32's range, a <see cref="PositiveInfinity"/> or <see cref="NegativeInfinity"/> is returned. </returns>
135
public static
Decimal32
Parse(string s, IFormatProvider? provider) => Parse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider);
138
/// Parses a <see cref="
Decimal32
"/> from a <see cref="ReadOnlySpan{Char}"/> and <see cref="IFormatProvider"/>.
143
/// <returns>The equivalent <see cref="
Decimal32
"/> value representing the input string. If the input exceeds Decimal32's range, a <see cref="PositiveInfinity"/> or <see cref="NegativeInfinity"/> is returned. </returns>
144
public static
Decimal32
Parse(ReadOnlySpan<char> s, NumberStyles style = NumberStyles.Float | NumberStyles.AllowThousands, IFormatProvider? provider = null)
147
return Number.ParseDecimalIeee754<char,
Decimal32
, uint>(s, style, NumberFormatInfo.GetInstance(provider));
151
/// Parses a <see cref="
Decimal32
"/> from a <see cref="string"/> with the given <see cref="NumberStyles"/> and <see cref="IFormatProvider"/>.
156
/// <returns>The equivalent <see cref="
Decimal32
"/> value representing the input string. If the input exceeds Decimal32's range, a <see cref="PositiveInfinity"/> or <see cref="NegativeInfinity"/> is returned. </returns>
157
public static
Decimal32
Parse(string s, NumberStyles style, IFormatProvider? provider)
167
/// Tries to parse a <see cref="
Decimal32
"/> from a <see cref="string"/> in the default parse style.
170
/// <param name="result">The equivalent <see cref="
Decimal32
"/> value representing the input string if the parse was successful. If the input exceeds Decimal32's range, a <see cref="PositiveInfinity"/> or <see cref="NegativeInfinity"/> is returned. If the parse was unsuccessful, a default <see cref="
Decimal32
"/> value is returned.</param>
172
public static bool TryParse([NotNullWhen(true)] string? s, out
Decimal32
result) => TryParse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider: null, out result);
175
/// Tries to parse a <see cref="
Decimal32
"/> from a <see cref="ReadOnlySpan{Char}"/> in the default parse style.
178
/// <param name="result">The equivalent <see cref="
Decimal32
"/> value representing the input string if the parse was successful. If the input exceeds Decimal32's range, a <see cref="PositiveInfinity"/> or <see cref="NegativeInfinity"/> is returned. If the parse was unsuccessful, a default <see cref="
Decimal32
"/> value is returned.</param>
180
public static bool TryParse(ReadOnlySpan<char> s, out
Decimal32
result) => TryParse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider: null, out result);
183
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, [MaybeNullWhen(false)] out
Decimal32
result) => TryParse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider, out result);
186
/// Tries to parse a <see cref="
Decimal32
"/> from a <see cref="string"/> with the given <see cref="IFormatProvider"/>.
190
/// <param name="result">The equivalent <see cref="
Decimal32
"/> value representing the input string if the parse was successful. If the input exceeds Decimal32's range, a <see cref="PositiveInfinity"/> or <see cref="NegativeInfinity"/> is returned. If the parse was unsuccessful, a default <see cref="
Decimal32
"/> value is returned.</param>
192
public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, [MaybeNullWhen(false)] out
Decimal32
result) => TryParse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider, out result);
195
/// Tries to parse a <see cref="
Decimal32
"/> from a <see cref="ReadOnlySpan{Char}"/> with the given <see cref="NumberStyles"/> and <see cref="IFormatProvider"/>.
200
/// <param name="result">The equivalent <see cref="
Decimal32
"/> value representing the input string if the parse was successful. If the input exceeds Decimal32's range, a <see cref="PositiveInfinity"/> or <see cref="NegativeInfinity"/> is returned. If the parse was unsuccessful, a default <see cref="
Decimal32
"/> value is returned.</param>
202
public static bool TryParse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider? provider, [MaybeNullWhen(false)] out
Decimal32
result)
205
return Number.TryParseDecimalIeee754<char,
Decimal32
, uint>(s, style, NumberFormatInfo.GetInstance(provider), out result, out _) == Number.ParsingStatus.OK;
209
/// Tries to parse a <see cref="
Decimal32
"/> from a <see cref="string"/> with the given <see cref="NumberStyles"/> and <see cref="IFormatProvider"/>.
214
/// <param name="result">The equivalent <see cref="
Decimal32
"/> value representing the input string if the parse was successful. If the input exceeds Decimal32's range, a <see cref="PositiveInfinity"/> or <see cref="NegativeInfinity"/> is returned. If the parse was unsuccessful, a default <see cref="
Decimal32
"/> value is returned.</param>
216
public static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, [MaybeNullWhen(false)] out
Decimal32
result)
219
return Number.TryParseDecimalIeee754<char,
Decimal32
, uint>(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) == Number.ParsingStatus.OK;
230
if (value is not
Decimal32
i)
235
return Number.CompareDecimalIeee754<
Decimal32
, uint>(_value, i._value);
239
public int CompareTo(
Decimal32
other)
241
return Number.CompareDecimalIeee754<
Decimal32
, uint>(_value, other._value);
245
public bool Equals(
Decimal32
other)
247
return Number.CompareDecimalIeee754<
Decimal32
, uint>(_value, other._value) == 0;
255
return obj is
Decimal32
other && Equals(other);
263
return Number.GetDecimalIeee754HashCode<
Decimal32
, uint>(_value);
270
public static uint EncodeBinary(
Decimal32
x) => x._value;
276
public static
Decimal32
DecodeBinary(uint x) => new Decimal32(x);
282
public static uint EncodeDecimal(
Decimal32
x) => Number.EncodeDecimalIeee754<
Decimal32
, uint>(x._value);
288
public static
Decimal32
DecodeDecimal(uint x) => new Decimal32(Number.DecodeDecimalIeee754<
Decimal32
, uint>(x));
295
return Number.FormatDecimalIeee754<
Decimal32
, uint>(_value, null, NumberFormatInfo.CurrentInfo);
303
return Number.FormatDecimalIeee754<
Decimal32
, uint>(_value, format, NumberFormatInfo.CurrentInfo);
311
return Number.FormatDecimalIeee754<
Decimal32
, uint>(_value, null, NumberFormatInfo.GetInstance(provider));
319
return Number.FormatDecimalIeee754<
Decimal32
, uint>(_value, format, NumberFormatInfo.GetInstance(provider));
325
return Number.TryFormatDecimalIeee754<
Decimal32
, uint, char>(_value, format, NumberFormatInfo.GetInstance(provider), destination, out charsWritten);
331
return Number.TryFormatDecimalIeee754<
Decimal32
, uint, byte>(_value, format, NumberFormatInfo.GetInstance(provider), utf8Destination, out bytesWritten);
337
public static
Decimal32
operator +(
Decimal32
value) => value;
342
public static
Decimal32
operator -(
Decimal32
value) => new Decimal32(value._value ^ SignMask);
347
public static
Decimal32
operator ++(
Decimal32
value)
349
return new Decimal32(Number.AddDecimalIeee754<
Decimal32
, uint>(value._value, OneValue));
355
public static
Decimal32
operator --(
Decimal32
value)
357
return new Decimal32(Number.SubtractDecimalIeee754<
Decimal32
, uint>(value._value, OneValue));
364
public static
Decimal32
operator +(
Decimal32
left,
Decimal32
right)
366
return new Decimal32(Number.AddDecimalIeee754<
Decimal32
, uint>(left._value, right._value));
373
public static
Decimal32
operator -(
Decimal32
left,
Decimal32
right)
375
return new Decimal32(Number.SubtractDecimalIeee754<
Decimal32
, uint>(left._value, right._value));
382
public static
Decimal32
operator *(
Decimal32
left,
Decimal32
right)
384
return new Decimal32(Number.MultiplyDecimalIeee754<
Decimal32
, uint>(left._value, right._value));
391
public static
Decimal32
operator /(
Decimal32
left,
Decimal32
right)
393
return new Decimal32(Number.DivideDecimalIeee754<
Decimal32
, uint>(left._value, right._value));
400
public static
Decimal32
operator %(
Decimal32
left,
Decimal32
right)
402
return new Decimal32(Number.RemainderDecimalIeee754<
Decimal32
, uint>(left._value, right._value));
409
/// <summary>Explicitly converts a <see cref="int" /> value to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</summary>
411
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</returns>
412
public static explicit operator
Decimal32
(int value) => new Decimal32(Number.ConvertIntegerToDecimalIeee754<
Decimal32
, uint, int>(value));
414
/// <summary>Explicitly converts a <see cref="uint" /> value to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</summary>
416
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</returns>
418
public static explicit operator
Decimal32
(uint value) => new Decimal32(Number.ConvertIntegerToDecimalIeee754<
Decimal32
, uint, uint>(value));
420
/// <summary>Explicitly converts a <see cref="System.IntPtr" /> value to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</summary>
422
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</returns>
423
public static explicit operator
Decimal32
(nint value) => new Decimal32(Number.ConvertIntegerToDecimalIeee754<
Decimal32
, uint, nint>(value));
425
/// <summary>Explicitly converts a <see cref="System.UIntPtr" /> value to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</summary>
427
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</returns>
429
public static explicit operator
Decimal32
(nuint value) => new Decimal32(Number.ConvertIntegerToDecimalIeee754<
Decimal32
, uint, nuint>(value));
431
/// <summary>Explicitly converts a <see cref="long" /> value to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</summary>
433
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</returns>
434
public static explicit operator
Decimal32
(long value) => new Decimal32(Number.ConvertIntegerToDecimalIeee754<
Decimal32
, uint, long>(value));
436
/// <summary>Explicitly converts a <see cref="ulong" /> value to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</summary>
438
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</returns>
440
public static explicit operator
Decimal32
(ulong value) => new Decimal32(Number.ConvertIntegerToDecimalIeee754<
Decimal32
, uint, ulong>(value));
442
/// <summary>Explicitly converts a <see cref="System.Int128" /> value to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</summary>
444
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</returns>
445
public static explicit operator
Decimal32
(Int128 value) => new Decimal32(Number.ConvertIntegerToDecimalIeee754<
Decimal32
, uint, Int128>(value));
447
/// <summary>Explicitly converts a <see cref="System.UInt128" /> value to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</summary>
449
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</returns>
451
public static explicit operator
Decimal32
(UInt128 value) => new Decimal32(Number.ConvertIntegerToDecimalIeee754<
Decimal32
, uint, UInt128>(value));
453
/// <summary>Explicitly converts a <see cref="System.Half" /> value to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</summary>
455
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</returns>
456
public static explicit operator
Decimal32
(Half value) => new Decimal32(Number.ConvertFloatToDecimalIeee754<Half,
Decimal32
, uint>(value));
458
/// <summary>Explicitly converts a <see cref="float" /> value to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</summary>
460
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</returns>
461
public static explicit operator
Decimal32
(float value) => new Decimal32(Number.ConvertFloatToDecimalIeee754<float,
Decimal32
, uint>(value));
463
/// <summary>Explicitly converts a <see cref="double" /> value to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</summary>
465
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</returns>
466
public static explicit operator
Decimal32
(double value) => new Decimal32(Number.ConvertFloatToDecimalIeee754<double,
Decimal32
, uint>(value));
468
/// <summary>Explicitly converts a <see cref="System.Numerics.Decimal64" /> value to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</summary>
470
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</returns>
471
public static explicit operator
Decimal32
(Decimal64 value) => new Decimal32(Number.ConvertDecimalIeee754<Decimal64, ulong,
Decimal32
, uint>(value._value));
473
/// <summary>Explicitly converts a <see cref="System.Numerics.Decimal128" /> value to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</summary>
475
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</returns>
476
public static explicit operator
Decimal32
(Decimal128 value) => new Decimal32(Number.ConvertDecimalIeee754<Decimal128, UInt128,
Decimal32
, uint>(new UInt128(value._upper, value._lower)));
478
/// <summary>Explicitly converts a <see cref="decimal" /> value to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</summary>
480
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</returns>
481
public static explicit operator
Decimal32
(decimal value) => new Decimal32(Number.ConvertDecimalToDecimalIeee754<
Decimal32
, uint>(value));
487
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="byte" /> value.</summary>
490
public static explicit operator byte(
Decimal32
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal32
, uint, byte>(value._value, isChecked: false);
492
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="byte" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
496
public static explicit operator checked byte(
Decimal32
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal32
, uint, byte>(value._value, isChecked: true);
498
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="sbyte" /> value.</summary>
502
public static explicit operator sbyte(
Decimal32
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal32
, uint, sbyte>(value._value, isChecked: false);
504
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="sbyte" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
509
public static explicit operator checked sbyte(
Decimal32
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal32
, uint, sbyte>(value._value, isChecked: true);
511
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="char" /> value.</summary>
514
public static explicit operator char(
Decimal32
value) => (char)Number.ConvertDecimalIeee754ToInteger<
Decimal32
, uint, ushort>(value._value, isChecked: false);
516
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="char" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
520
public static explicit operator checked char(
Decimal32
value) => (char)Number.ConvertDecimalIeee754ToInteger<
Decimal32
, uint, ushort>(value._value, isChecked: true);
522
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="short" /> value.</summary>
525
public static explicit operator short(
Decimal32
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal32
, uint, short>(value._value, isChecked: false);
527
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="short" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
531
public static explicit operator checked short(
Decimal32
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal32
, uint, short>(value._value, isChecked: true);
533
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="ushort" /> value.</summary>
537
public static explicit operator ushort(
Decimal32
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal32
, uint, ushort>(value._value, isChecked: false);
539
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="ushort" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
544
public static explicit operator checked ushort(
Decimal32
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal32
, uint, ushort>(value._value, isChecked: true);
546
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="int" /> value.</summary>
549
public static explicit operator int(
Decimal32
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal32
, uint, int>(value._value, isChecked: false);
551
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="int" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
555
public static explicit operator checked int(
Decimal32
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal32
, uint, int>(value._value, isChecked: true);
557
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="uint" /> value.</summary>
561
public static explicit operator uint(
Decimal32
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal32
, uint, uint>(value._value, isChecked: false);
563
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="uint" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
568
public static explicit operator checked uint(
Decimal32
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal32
, uint, uint>(value._value, isChecked: true);
570
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="System.IntPtr" /> value.</summary>
573
public static explicit operator nint(
Decimal32
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal32
, uint, nint>(value._value, isChecked: false);
575
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="System.IntPtr" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
579
public static explicit operator checked nint(
Decimal32
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal32
, uint, nint>(value._value, isChecked: true);
581
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="System.UIntPtr" /> value.</summary>
585
public static explicit operator nuint(
Decimal32
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal32
, uint, nuint>(value._value, isChecked: false);
587
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="System.UIntPtr" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
592
public static explicit operator checked nuint(
Decimal32
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal32
, uint, nuint>(value._value, isChecked: true);
594
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="long" /> value.</summary>
597
public static explicit operator long(
Decimal32
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal32
, uint, long>(value._value, isChecked: false);
599
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="long" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
603
public static explicit operator checked long(
Decimal32
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal32
, uint, long>(value._value, isChecked: true);
605
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="ulong" /> value.</summary>
609
public static explicit operator ulong(
Decimal32
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal32
, uint, ulong>(value._value, isChecked: false);
611
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="ulong" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
616
public static explicit operator checked ulong(
Decimal32
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal32
, uint, ulong>(value._value, isChecked: true);
618
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="System.Int128" /> value.</summary>
621
public static explicit operator Int128(
Decimal32
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal32
, uint, Int128>(value._value, isChecked: false);
623
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="System.Int128" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
627
public static explicit operator checked Int128(
Decimal32
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal32
, uint, Int128>(value._value, isChecked: true);
629
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="System.UInt128" /> value.</summary>
633
public static explicit operator UInt128(
Decimal32
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal32
, uint, UInt128>(value._value, isChecked: false);
635
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="System.UInt128" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
640
public static explicit operator checked UInt128(
Decimal32
value) => Number.ConvertDecimalIeee754ToInteger<
Decimal32
, uint, UInt128>(value._value, isChecked: true);
642
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="System.Half" /> value.</summary>
645
public static explicit operator Half(
Decimal32
value) => Number.ConvertDecimalIeee754ToFloat<
Decimal32
, uint, Half>(value._value);
647
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="float" /> value.</summary>
650
public static explicit operator float(
Decimal32
value) => Number.ConvertDecimalIeee754ToFloat<
Decimal32
, uint, float>(value._value);
652
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="double" /> value.</summary>
655
public static explicit operator double(
Decimal32
value) => Number.ConvertDecimalIeee754ToFloat<
Decimal32
, uint, double>(value._value);
657
/// <summary>Explicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="decimal" /> value.</summary>
661
public static explicit operator decimal(
Decimal32
value) => Number.ConvertDecimalIeee754ToDecimal<
Decimal32
, uint>(value._value);
667
/// <summary>Implicitly converts a <see cref="byte" /> value to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</summary>
669
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</returns>
670
public static implicit operator
Decimal32
(byte value) => new Decimal32(Number.ConvertIntegerToDecimalIeee754<
Decimal32
, uint, byte>(value));
672
/// <summary>Implicitly converts a <see cref="sbyte" /> value to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</summary>
674
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</returns>
676
public static implicit operator
Decimal32
(sbyte value) => new Decimal32(Number.ConvertIntegerToDecimalIeee754<
Decimal32
, uint, sbyte>(value));
678
/// <summary>Implicitly converts a <see cref="char" /> value to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</summary>
680
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</returns>
681
public static implicit operator
Decimal32
(char value) => new Decimal32(Number.ConvertIntegerToDecimalIeee754<
Decimal32
, uint, ushort>(value));
683
/// <summary>Implicitly converts a <see cref="short" /> value to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</summary>
685
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</returns>
686
public static implicit operator
Decimal32
(short value) => new Decimal32(Number.ConvertIntegerToDecimalIeee754<
Decimal32
, uint, short>(value));
688
/// <summary>Implicitly converts a <see cref="ushort" /> value to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</summary>
690
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="System.Numerics.
Decimal32
" /> value.</returns>
692
public static implicit operator
Decimal32
(ushort value) => new Decimal32(Number.ConvertIntegerToDecimalIeee754<
Decimal32
, uint, ushort>(value));
698
/// <summary>Implicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="System.Numerics.Decimal64" /> value.</summary>
701
public static implicit operator Decimal64(
Decimal32
value) => new Decimal64(Number.ConvertDecimalIeee754<
Decimal32
, uint, Decimal64, ulong>(value._value));
703
/// <summary>Implicitly converts a <see cref="System.Numerics.
Decimal32
" /> value to its nearest representable <see cref="System.Numerics.Decimal128" /> value.</summary>
706
public static implicit operator Decimal128(
Decimal32
value) => new Decimal128(Number.ConvertDecimalIeee754<
Decimal32
, uint, Decimal128, UInt128>(value._value));
712
public static bool operator ==(
Decimal32
left,
Decimal32
right)
714
return Number.EqualsDecimalIeee754<
Decimal32
, uint>(left._value, right._value);
721
public static bool operator !=(
Decimal32
left,
Decimal32
right)
730
public static bool operator <(
Decimal32
left,
Decimal32
right)
732
return Number.LessThanDecimalIeee754<
Decimal32
, uint>(left._value, right._value);
739
public static bool operator >(
Decimal32
left,
Decimal32
right)
741
return Number.GreaterThanDecimalIeee754<
Decimal32
, uint>(left._value, right._value);
748
public static bool operator <=(
Decimal32
left,
Decimal32
right)
750
return Number.LessThanOrEqualDecimalIeee754<
Decimal32
, uint>(left._value, right._value);
757
public static bool operator >=(
Decimal32
left,
Decimal32
right)
759
return Number.GreaterThanOrEqualDecimalIeee754<
Decimal32
, uint>(left._value, right._value);
767
public static bool TryParsePartial([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out
Decimal32
result, out int charsConsumed)
770
return Number.TryParseDecimalIeee754<char,
Decimal32
, uint>(s.AsSpan(), style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) == Number.ParsingStatus.OK;
774
public static bool TryParsePartial(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider? provider, out
Decimal32
result, out int charsConsumed)
777
return Number.TryParseDecimalIeee754<char,
Decimal32
, uint>(s, style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) == Number.ParsingStatus.OK;
781
public static bool TryParsePartial(ReadOnlySpan<byte> utf8Text, NumberStyles style, IFormatProvider? provider, out
Decimal32
result, out int bytesConsumed)
784
return Number.TryParseDecimalIeee754<byte,
Decimal32
, uint>(utf8Text, style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out bytesConsumed) == Number.ParsingStatus.OK;
788
/// Tries to parse a <see cref="
Decimal32
"/> from a <see cref="ReadOnlySpan{Byte}"/> containing UTF-8 text in the default parse style.
791
/// <param name="result">The equivalent <see cref="
Decimal32
"/> value representing the input if the parse was successful. If the input exceeds Decimal32's range, a <see cref="PositiveInfinity"/> or <see cref="NegativeInfinity"/> is returned. If the parse was unsuccessful, a default <see cref="
Decimal32
"/> value is returned.</param>
793
public static bool TryParse(ReadOnlySpan<byte> utf8Text, out
Decimal32
result) => TryParse(utf8Text, provider: null, out result);
796
public static
Decimal32
Parse(ReadOnlySpan<byte> utf8Text, NumberStyles style = NumberStyles.Float | NumberStyles.AllowThousands, IFormatProvider? provider = null)
799
return Number.ParseDecimalIeee754<byte,
Decimal32
, uint>(utf8Text, style, NumberFormatInfo.GetInstance(provider));
803
public static
Decimal32
Parse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider) => Parse(utf8Text, NumberStyles.Float | NumberStyles.AllowThousands, provider);
806
public static bool TryParse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider, [MaybeNullWhen(false)] out
Decimal32
result) => Number.TryParseDecimalIeee754<byte,
Decimal32
, uint>(utf8Text, NumberStyles.Float | NumberStyles.AllowThousands, NumberFormatInfo.GetInstance(provider), out result, out _) == Number.ParsingStatus.OK;
809
public static
Decimal32
One => new Decimal32(OneValue);
812
public static
Decimal32
NegativeOne => new Decimal32(NegativeOneValue);
815
public static
Decimal32
E => new Decimal32(EValue);
818
public static
Decimal32
Pi => new Decimal32(PiValue);
821
public static
Decimal32
Tau => new Decimal32(TauValue);
828
public static
Decimal32
Ceiling(
Decimal32
x) => new Decimal32(Number.RoundDecimalIeee754<
Decimal32
, uint>(x._value, 0, MidpointRounding.ToPositiveInfinity));
831
public static TInteger ConvertToInteger<TInteger>(
Decimal32
value)
835
public static TInteger ConvertToIntegerNative<TInteger>(
Decimal32
value)
839
public static
Decimal32
Floor(
Decimal32
x) => new Decimal32(Number.RoundDecimalIeee754<
Decimal32
, uint>(x._value, 0, MidpointRounding.ToNegativeInfinity));
842
public static
Decimal32
Round(
Decimal32
x) => new Decimal32(Number.RoundDecimalIeee754<
Decimal32
, uint>(x._value, 0, MidpointRounding.ToEven));
845
public static
Decimal32
Round(
Decimal32
x, int digits) => new Decimal32(Number.RoundDecimalIeee754<
Decimal32
, uint>(x._value, digits, MidpointRounding.ToEven));
848
public static
Decimal32
Round(
Decimal32
x, MidpointRounding mode) => new Decimal32(Number.RoundDecimalIeee754<
Decimal32
, uint>(x._value, 0, mode));
851
public static
Decimal32
Round(
Decimal32
x, int digits, MidpointRounding mode) => new Decimal32(Number.RoundDecimalIeee754<
Decimal32
, uint>(x._value, digits, mode));
854
public static
Decimal32
Truncate(
Decimal32
x) => new Decimal32(Number.RoundDecimalIeee754<
Decimal32
, uint>(x._value, 0, MidpointRounding.ToZero));
857
int IFloatingPoint<
Decimal32
>.GetExponentByteCount() => sizeof(int);
860
int IFloatingPoint<
Decimal32
>.GetExponentShortestBitLength()
862
int exponent = Number.UnpackDecimalIeee754<
Decimal32
, uint>(_value).UnbiasedExponent;
875
int IFloatingPoint<
Decimal32
>.GetSignificandBitLength() => 24;
878
int IFloatingPoint<
Decimal32
>.GetSignificandByteCount() => sizeof(uint);
881
bool IFloatingPoint<
Decimal32
>.TryWriteExponentBigEndian(Span<byte> destination, out int bytesWritten)
883
if (BinaryPrimitives.TryWriteInt32BigEndian(destination, Number.UnpackDecimalIeee754<
Decimal32
, uint>(_value).UnbiasedExponent))
894
bool IFloatingPoint<
Decimal32
>.TryWriteExponentLittleEndian(Span<byte> destination, out int bytesWritten)
896
if (BinaryPrimitives.TryWriteInt32LittleEndian(destination, Number.UnpackDecimalIeee754<
Decimal32
, uint>(_value).UnbiasedExponent))
907
bool IFloatingPoint<
Decimal32
>.TryWriteSignificandBigEndian(Span<byte> destination, out int bytesWritten)
909
if (BinaryPrimitives.TryWriteUInt32BigEndian(destination, Number.UnpackDecimalIeee754<
Decimal32
, uint>(_value).Significand))
920
bool IFloatingPoint<
Decimal32
>.TryWriteSignificandLittleEndian(Span<byte> destination, out int bytesWritten)
922
if (BinaryPrimitives.TryWriteUInt32LittleEndian(destination, Number.UnpackDecimalIeee754<
Decimal32
, uint>(_value).Significand))
937
public static
Decimal32
Acos(
Decimal32
x) => new Decimal32(Number.AcosDecimalIeee754<
Decimal32
, uint>(x._value));
940
public static
Decimal32
AcosPi(
Decimal32
x) => new Decimal32(Number.AcosPiDecimalIeee754<
Decimal32
, uint>(x._value));
943
public static
Decimal32
Acosh(
Decimal32
x) => new Decimal32(Number.AcoshDecimalIeee754<
Decimal32
, uint>(x._value));
946
public static
Decimal32
Asin(
Decimal32
x) => new Decimal32(Number.AsinDecimalIeee754<
Decimal32
, uint>(x._value));
949
public static
Decimal32
AsinPi(
Decimal32
x) => new Decimal32(Number.AsinPiDecimalIeee754<
Decimal32
, uint>(x._value));
952
public static
Decimal32
Asinh(
Decimal32
x) => new Decimal32(Number.AsinhDecimalIeee754<
Decimal32
, uint>(x._value));
955
public static
Decimal32
Atan(
Decimal32
x) => new Decimal32(Number.AtanDecimalIeee754<
Decimal32
, uint>(x._value));
958
public static
Decimal32
Atan2(
Decimal32
y,
Decimal32
x) => new Decimal32(Number.Atan2DecimalIeee754<
Decimal32
, uint>(y._value, x._value));
961
public static
Decimal32
Atan2Pi(
Decimal32
y,
Decimal32
x) => new Decimal32(Number.Atan2PiDecimalIeee754<
Decimal32
, uint>(y._value, x._value));
964
public static
Decimal32
AtanPi(
Decimal32
x) => new Decimal32(Number.AtanPiDecimalIeee754<
Decimal32
, uint>(x._value));
967
public static
Decimal32
Atanh(
Decimal32
x) => new Decimal32(Number.AtanhDecimalIeee754<
Decimal32
, uint>(x._value));
970
public static
Decimal32
BitDecrement(
Decimal32
x) => new Decimal32(Number.BitDecrementDecimalIeee754<
Decimal32
, uint>(x._value));
973
public static
Decimal32
BitIncrement(
Decimal32
x) => new Decimal32(Number.BitIncrementDecimalIeee754<
Decimal32
, uint>(x._value));
976
public static
Decimal32
Cbrt(
Decimal32
x) => new Decimal32(Number.CbrtDecimalIeee754<
Decimal32
, uint>(x._value));
979
public static
Decimal32
Cos(
Decimal32
x) => new Decimal32(Number.CosDecimalIeee754<
Decimal32
, uint>(x._value));
982
public static
Decimal32
CosPi(
Decimal32
x) => new Decimal32(Number.CosPiDecimalIeee754<
Decimal32
, uint>(x._value));
985
public static
Decimal32
Cosh(
Decimal32
x) => new Decimal32(Number.CoshDecimalIeee754<
Decimal32
, uint>(x._value));
988
public static
Decimal32
DegreesToRadians(
Decimal32
degrees) => new Decimal32(Number.MultiplyByWideConstantDecimalIeee754<
Decimal32
, uint>(degrees._value, DegreesToRadiansHead, DegreesToRadiansTail, DegreesToRadiansExponent));
991
public static
Decimal32
Exp(
Decimal32
x) => new Decimal32(Number.ExpDecimalIeee754<
Decimal32
, uint>(x._value));
994
public static
Decimal32
Exp10(
Decimal32
x) => new Decimal32(Number.Exp10DecimalIeee754<
Decimal32
, uint>(x._value));
997
public static
Decimal32
Exp10M1(
Decimal32
x) => new Decimal32(Number.Exp10M1DecimalIeee754<
Decimal32
, uint>(x._value));
1000
public static
Decimal32
Exp2(
Decimal32
x) => new Decimal32(Number.Exp2DecimalIeee754<
Decimal32
, uint>(x._value));
1003
public static
Decimal32
Exp2M1(
Decimal32
x) => new Decimal32(Number.Exp2M1DecimalIeee754<
Decimal32
, uint>(x._value));
1006
public static
Decimal32
ExpM1(
Decimal32
x) => new Decimal32(Number.ExpM1DecimalIeee754<
Decimal32
, uint>(x._value));
1009
public static
Decimal32
FusedMultiplyAdd(
Decimal32
left,
Decimal32
right,
Decimal32
addend) => new Decimal32(Number.FusedMultiplyAddDecimalIeee754<
Decimal32
, uint>(left._value, right._value, addend._value));
1012
public static
Decimal32
Hypot(
Decimal32
x,
Decimal32
y) => new Decimal32(Number.HypotDecimalIeee754<
Decimal32
, uint>(x._value, y._value));
1015
public static
Decimal32
Ieee754Remainder(
Decimal32
left,
Decimal32
right) => new Decimal32(Number.Ieee754RemainderDecimalIeee754<
Decimal32
, uint>(left._value, right._value));
1018
public static int ILogB(
Decimal32
x) => Number.ILogBDecimalIeee754<
Decimal32
, uint>(x._value);
1021
public static
Decimal32
Lerp(
Decimal32
value1,
Decimal32
value2,
Decimal32
amount) => MultiplyAddEstimate(value1, One - amount, value2 * amount);
1024
public static
Decimal32
Log(
Decimal32
x) => new Decimal32(Number.LogDecimalIeee754<
Decimal32
, uint>(x._value));
1027
public static
Decimal32
Log(
Decimal32
x,
Decimal32
newBase) => new Decimal32(Number.LogDecimalIeee754<
Decimal32
, uint>(x._value, newBase._value));
1030
public static
Decimal32
Log10(
Decimal32
x) => new Decimal32(Number.Log10DecimalIeee754<
Decimal32
, uint>(x._value));
1033
public static
Decimal32
Log10P1(
Decimal32
x) => new Decimal32(Number.Log10P1DecimalIeee754<
Decimal32
, uint>(x._value));
1036
public static
Decimal32
Log2(
Decimal32
x) => new Decimal32(Number.Log2DecimalIeee754<
Decimal32
, uint>(x._value));
1039
public static
Decimal32
Log2P1(
Decimal32
x) => new Decimal32(Number.Log2P1DecimalIeee754<
Decimal32
, uint>(x._value));
1042
public static
Decimal32
LogP1(
Decimal32
x) => new Decimal32(Number.LogP1DecimalIeee754<
Decimal32
, uint>(x._value));
1045
public static
Decimal32
Pow(
Decimal32
x,
Decimal32
y) => new Decimal32(Number.PowDecimalIeee754<
Decimal32
, uint>(x._value, y._value));
1048
public static
Decimal32
RadiansToDegrees(
Decimal32
radians) => new Decimal32(Number.MultiplyByWideConstantDecimalIeee754<
Decimal32
, uint>(radians._value, RadiansToDegreesHead, RadiansToDegreesTail, RadiansToDegreesExponent));
1051
public static
Decimal32
ReciprocalEstimate(
Decimal32
x) => One / x;
1054
public static
Decimal32
ReciprocalSqrtEstimate(
Decimal32
x) => One / Sqrt(x);
1057
public static
Decimal32
RootN(
Decimal32
x, int n) => new Decimal32(Number.RootNDecimalIeee754<
Decimal32
, uint>(x._value, n));
1060
public static
Decimal32
ScaleB(
Decimal32
x, int n) => new Decimal32(Number.ScaleBDecimalIeee754<
Decimal32
, uint>(x._value, n));
1063
public static
Decimal32
Sin(
Decimal32
x) => new Decimal32(Number.SinDecimalIeee754<
Decimal32
, uint>(x._value));
1066
public static (
Decimal32
Sin,
Decimal32
Cos) SinCos(
Decimal32
x)
1068
(uint sin, uint cos) = Number.SinCosDecimalIeee754<
Decimal32
, uint>(x._value);
1073
public static (
Decimal32
SinPi,
Decimal32
CosPi) SinCosPi(
Decimal32
x)
1075
(uint sin, uint cos) = Number.SinCosPiDecimalIeee754<
Decimal32
, uint>(x._value);
1080
public static
Decimal32
SinPi(
Decimal32
x) => new Decimal32(Number.SinPiDecimalIeee754<
Decimal32
, uint>(x._value));
1083
public static
Decimal32
Sinh(
Decimal32
x) => new Decimal32(Number.SinhDecimalIeee754<
Decimal32
, uint>(x._value));
1086
public static
Decimal32
Sqrt(
Decimal32
x) => new Decimal32(Number.SqrtDecimalIeee754<
Decimal32
, uint>(x._value));
1089
public static
Decimal32
Tan(
Decimal32
x) => new Decimal32(Number.TanDecimalIeee754<
Decimal32
, uint>(x._value));
1092
public static
Decimal32
TanPi(
Decimal32
x) => new Decimal32(Number.TanPiDecimalIeee754<
Decimal32
, uint>(x._value));
1095
public static
Decimal32
Tanh(
Decimal32
x) => new Decimal32(Number.TanhDecimalIeee754<
Decimal32
, uint>(x._value));
1101
public static
Decimal32
Quantize(
Decimal32
x,
Decimal32
y) => new Decimal32(Number.QuantizeDecimalIeee754<
Decimal32
, uint>(x._value, y._value));
1106
public static
Decimal32
GetQuantum(
Decimal32
x) => new Decimal32(Number.QuantumDecimalIeee754<
Decimal32
, uint>(x._value));
1112
public static bool HaveSameQuantum(
Decimal32
x,
Decimal32
y) => Number.SameQuantumDecimalIeee754<
Decimal32
, uint>(x._value, y._value);
1117
public static
Decimal32
Abs(
Decimal32
value) => new Decimal32(Number.AbsDecimalIeee754<
Decimal32
, uint>(value._value));
1122
public static bool IsFinite(
Decimal32
value) => (value._value & InfinityMask) != InfinityMask;
1127
public static bool IsInfinity(
Decimal32
value) => (value._value & NaNMask) == InfinityMask;
1132
public static bool IsNaN(
Decimal32
value) => (value._value & NaNMask) == NaNMask;
1137
public static bool IsNegative(
Decimal32
value) => (value._value & SignMask) != 0;
1142
public static bool IsNegativeInfinity(
Decimal32
value) => (value._value & (SignMask | NaNMask)) == NegativeInfinityValue;
1147
public static bool IsPositive(
Decimal32
value) => (value._value & SignMask) == 0;
1152
public static bool IsPositiveInfinity(
Decimal32
value) => (value._value & (SignMask | NaNMask)) == PositiveInfinityValue;
1157
public static bool IsRealNumber(
Decimal32
value) => !IsNaN(value);
1162
public static bool IsInteger(
Decimal32
value) => Number.IsIntegerDecimalIeee754<
Decimal32
, uint>(value._value);
1167
public static bool IsEvenInteger(
Decimal32
value) => Number.IsEvenIntegerDecimalIeee754<
Decimal32
, uint>(value._value);
1172
public static bool IsOddInteger(
Decimal32
value) => Number.IsOddIntegerDecimalIeee754<
Decimal32
, uint>(value._value);
1177
public static bool IsNormal(
Decimal32
value) => Number.IsNormalDecimalIeee754<
Decimal32
, uint>(value._value);
1182
public static bool IsSubnormal(
Decimal32
value) => Number.IsSubnormalDecimalIeee754<
Decimal32
, uint>(value._value);
1188
public static
Decimal32
MaxMagnitude(
Decimal32
x,
Decimal32
y) => new Decimal32(Number.MaxMagnitudeDecimalIeee754<
Decimal32
, uint>(x._value, y._value));
1194
public static
Decimal32
MaxMagnitudeNumber(
Decimal32
x,
Decimal32
y) => new Decimal32(Number.MaxMagnitudeNumberDecimalIeee754<
Decimal32
, uint>(x._value, y._value));
1200
public static
Decimal32
MinMagnitude(
Decimal32
x,
Decimal32
y) => new Decimal32(Number.MinMagnitudeDecimalIeee754<
Decimal32
, uint>(x._value, y._value));
1206
public static
Decimal32
MinMagnitudeNumber(
Decimal32
x,
Decimal32
y) => new Decimal32(Number.MinMagnitudeNumberDecimalIeee754<
Decimal32
, uint>(x._value, y._value));
1213
public static
Decimal32
MultiplyAddEstimate(
Decimal32
left,
Decimal32
right,
Decimal32
addend) => (left * right) + addend;
1221
public static
Decimal32
Clamp(
Decimal32
value,
Decimal32
min,
Decimal32
max)
1236
public static
Decimal32
ClampNative(
Decimal32
value,
Decimal32
min,
Decimal32
max)
1249
public static
Decimal32
CopySign(
Decimal32
value,
Decimal32
sign) => new Decimal32(Number.CopySignDecimalIeee754<
Decimal32
, uint>(value._value, sign._value));
1255
public static
Decimal32
Max(
Decimal32
x,
Decimal32
y) => new Decimal32(Number.MaxDecimalIeee754<
Decimal32
, uint>(x._value, y._value));
1261
public static
Decimal32
MaxNative(
Decimal32
x,
Decimal32
y) => new Decimal32(Number.MaxNativeDecimalIeee754<
Decimal32
, uint>(x._value, y._value));
1267
public static
Decimal32
MaxNumber(
Decimal32
x,
Decimal32
y) => new Decimal32(Number.MaxNumberDecimalIeee754<
Decimal32
, uint>(x._value, y._value));
1273
public static
Decimal32
Min(
Decimal32
x,
Decimal32
y) => new Decimal32(Number.MinDecimalIeee754<
Decimal32
, uint>(x._value, y._value));
1279
public static
Decimal32
MinNative(
Decimal32
x,
Decimal32
y) => new Decimal32(Number.MinNativeDecimalIeee754<
Decimal32
, uint>(x._value, y._value));
1285
public static
Decimal32
MinNumber(
Decimal32
x,
Decimal32
y) => new Decimal32(Number.MinNumberDecimalIeee754<
Decimal32
, uint>(x._value, y._value));
1291
public static int Sign(
Decimal32
value) => Number.SignDecimalIeee754<
Decimal32
, uint>(value._value);
1294
static int INumberBase<
Decimal32
>.Radix => 10;
1297
static bool INumberBase<
Decimal32
>.IsCanonical(
Decimal32
value) => Number.IsCanonicalDecimalIeee754<
Decimal32
, uint>(value._value, nanReservedMask: 0x01F0_0000, nanPayloadMask: NaNPayloadMask, maxNaNPayload: 999_999);
1300
static bool INumberBase<
Decimal32
>.IsComplexNumber(
Decimal32
value) => false;
1303
static bool INumberBase<
Decimal32
>.IsImaginaryNumber(
Decimal32
value) => false;
1306
static bool INumberBase<
Decimal32
>.IsZero(
Decimal32
value) => Number.IsZeroDecimalIeee754<
Decimal32
, uint>(value._value);
1309
static
Decimal32
IAdditiveIdentity<
Decimal32
,
Decimal32
>.AdditiveIdentity => Zero;
1312
static
Decimal32
IMultiplicativeIdentity<
Decimal32
,
Decimal32
>.MultiplicativeIdentity => One;
1316
public static
Decimal32
CreateChecked<TOther>(TOther value)
1319
Decimal32
result;
1321
if (typeof(TOther) == typeof(
Decimal32
))
1323
result = (
Decimal32
)(object)value;
1335
public static
Decimal32
CreateSaturating<TOther>(TOther value)
1338
Decimal32
result;
1340
if (typeof(TOther) == typeof(
Decimal32
))
1342
result = (
Decimal32
)(object)value;
1354
public static
Decimal32
CreateTruncating<TOther>(TOther value)
1357
Decimal32
result;
1359
if (typeof(TOther) == typeof(
Decimal32
))
1361
result = (
Decimal32
)(object)value;
1373
static bool INumberBase<
Decimal32
>.TryConvertFromChecked<TOther>(TOther value, out
Decimal32
result) => TryConvertFrom(value, out result);
1377
static bool INumberBase<
Decimal32
>.TryConvertFromSaturating<TOther>(TOther value, out
Decimal32
result) => TryConvertFrom(value, out result);
1381
static bool INumberBase<
Decimal32
>.TryConvertFromTruncating<TOther>(TOther value, out
Decimal32
result) => TryConvertFrom(value, out result);
1384
private static bool TryConvertFrom<TOther>(TOther value, out
Decimal32
result)
1418
result = (
Decimal32
)(int)(object)value;
1423
result = (
Decimal32
)(uint)(object)value;
1428
result = (
Decimal32
)(long)(object)value;
1433
result = (
Decimal32
)(ulong)(object)value;
1438
result = (
Decimal32
)(Int128)(object)value;
1443
result = (
Decimal32
)(UInt128)(object)value;
1448
result = (
Decimal32
)(nint)(object)value;
1453
result = (
Decimal32
)(nuint)(object)value;
1458
result = (
Decimal32
)(Half)(object)value;
1463
result = (
Decimal32
)(float)(object)value;
1468
result = (
Decimal32
)(double)(object)value;
1473
result = (
Decimal32
)(decimal)(object)value;
1478
result = (
Decimal32
)(Decimal64)(object)value;
1483
result = (
Decimal32
)(Decimal128)(object)value;
1495
static bool INumberBase<
Decimal32
>.TryConvertToChecked<TOther>(
Decimal32
value, [MaybeNullWhen(false)] out TOther result)
1618
static bool INumberBase<
Decimal32
>.TryConvertToSaturating<TOther>(
Decimal32
value, [MaybeNullWhen(false)] out TOther result) => TryConvertTo(value, out result);
1622
static bool INumberBase<
Decimal32
>.TryConvertToTruncating<TOther>(
Decimal32
value, [MaybeNullWhen(false)] out TOther result) => TryConvertTo(value, out result);
1625
private static bool TryConvertTo<TOther>(
Decimal32
value, [MaybeNullWhen(false)] out TOther result)
1744
static int IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.Precision => Precision;
1746
static int IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.BufferLength => Number.Decimal32NumberBufferLength;
1748
static string IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.ToDecStr(uint significand)
1753
static unsafe uint IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.NumberToSignificand(ref Number.NumberBuffer number, int digits)
1758
static
Decimal32
IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.Construct(uint value) => new Decimal32(value);
1760
static int IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.ConvertToExponent(uint value) => (int)value;
1762
static uint IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.Power10(int exponent) => UInt32Powers10[exponent];
1764
static (uint Quotient, uint Remainder) IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.DivRemPow10(uint value, int exponent)
1769
static int IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.CountDigits(uint significand) => FormattingHelpers.CountDigits(significand);
1771
static int IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.MaxExponent => MaxExponent;
1773
static int IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.MinExponent => MinExponent;
1775
static int IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.MaxAdjustedExponent => MaxExponent - Precision + 1;
1777
static int IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.MinAdjustedExponent => MinExponent - Precision + 1;
1779
static uint IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.PositiveInfinity => PositiveInfinityValue;
1781
static uint IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.NegativeInfinity => NegativeInfinityValue;
1783
static uint IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.Zero => ZeroValue;
1785
static uint IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.NaN => QuietNaNValue;
1787
static uint IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.MostSignificantBitOfSignificandMask => MostSignificantBitOfSignificandMask;
1789
static uint IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.NaNMask => NaNMask;
1791
static uint IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.SNaNMask => SNaNMask;
1793
static uint IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.NaNPayloadMask => NaNPayloadMask;
1795
static uint IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.SignMask => SignMask;
1797
static uint IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.G0G1Mask => G0G1Mask;
1799
static int IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.ExponentBias => ExponentBias;
1801
static int IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.NumberBitsSignificand => 20;
1803
static uint IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.G0ToGwPlus1ExponentMask => 0x7F80_0000;
1805
static uint IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.G2ToGwPlus3ExponentMask => 0x1FE0_0000;
1807
static uint IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.GwPlus2ToGwPlus4SignificandMask => 0x007F_FFFF;
1809
static uint IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.GwPlus4SignificandMask => 0x001F_FFFF;
1811
static uint IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.MaxSignificand => MaxSignificand;
1813
static bool IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.IsNaN(uint decimalBits) => IsNaN(new Decimal32(decimalBits));
1815
static bool IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.IsNegative(uint decimalBits) => IsNegative(new Decimal32(decimalBits));
1817
static bool IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.IsFinite(uint decimalBits) => IsFinite(new Decimal32(decimalBits));
1819
static bool IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.IsInfinity(uint decimalBits) => IsInfinity(new Decimal32(decimalBits));
1821
static bool IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.IsPositiveInfinity(uint decimalBits) => IsPositiveInfinity(new Decimal32(decimalBits));
1823
static bool IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.IsNegativeInfinity(uint decimalBits) => IsNegativeInfinity(new Decimal32(decimalBits));
1825
static uint IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.EncodeExponentToG0ThroughGwPlus1(uint biasedExponent)
1830
static uint IDecimalIeee754ParseAndFormatInfo<
Decimal32
, uint>.EncodeExponentToG2ThroughGwPlus3(uint biasedExponent)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal64.cs (6)
1469
else if (typeof(TOther) == typeof(
Decimal32
))
1471
result = (
Decimal32
)(object)value;
1592
else if (typeof(TOther) == typeof(
Decimal32
))
1594
result = (TOther)(object)(
Decimal32
)value;
1719
else if (typeof(TOther) == typeof(
Decimal32
))
1721
result = (TOther)(object)(
Decimal32
)value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\TotalOrderIeee754Comparer.cs (4)
74
else if (typeof(T) == typeof(
Decimal32
))
76
return CompareDecimal<
Decimal32
, uint>(((
Decimal32
)(object)x!)._value, ((
Decimal32
)(object)y!)._value);
System.Runtime (1)
src\runtime\artifacts\obj\System.Runtime\Release\net11.0\System.Runtime.Forwards.cs (1)
379
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.
Decimal32
))]
System.Text.Json (6)
System\Text\Json\Nodes\JsonValueOfT.cs (1)
108
if (type == typeof(System.Numerics.BFloat16) || type == typeof(System.Numerics.
Decimal32
) ||
System\Text\Json\Serialization\Converters\Value\JsonPrimitiveConverter.cs (1)
39
typeof(T) == typeof(System.Numerics.BFloat16) || typeof(T) == typeof(System.Numerics.
Decimal32
) ||
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Converters.cs (3)
187
/// Returns a <see cref="JsonConverter{T}"/> instance that converts <see cref="System.Numerics.
Decimal32
"/> values.
190
public static JsonConverter<System.Numerics.
Decimal32
> Decimal32Converter =>
191
field ??= new Ieee754FloatingPointConverter<System.Numerics.
Decimal32
>(NumericType.Decimal32);
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (1)
730
potentialNumberType == typeof(System.Numerics.
Decimal32
) ||