1040 references to Number
System.Private.CoreLib (1040)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.Integer.cs (20)
138
return
Number
.TryUInt32ToDecStr(value, destination, out bytesWritten);
144
return
Number
.TryUInt32ToDecStr(value, format.PrecisionOrZero, destination, out bytesWritten);
147
return
Number
.TryInt32ToHexStr((int)value,
Number
.GetHexBase(format.Symbol), format.PrecisionOrZero, destination, out bytesWritten);
195
Number
.TryUInt32ToDecStr((uint)value, destination, out bytesWritten) :
196
Number
.TryNegativeInt32ToDecStr(value, format.PrecisionOrZero, "-"u8, destination, out bytesWritten);
203
Number
.TryUInt32ToDecStr((uint)value, format.PrecisionOrZero, destination, out bytesWritten) :
204
Number
.TryNegativeInt32ToDecStr(value, format.PrecisionOrZero, "-"u8, destination, out bytesWritten);
207
return
Number
.TryInt32ToHexStr(value & hexMask,
Number
.GetHexBase(format.Symbol), format.PrecisionOrZero, destination, out bytesWritten);
252
return
Number
.TryUInt64ToDecStr(value, destination, out bytesWritten);
258
return
Number
.TryUInt64ToDecStr(value, format.PrecisionOrZero, destination, out bytesWritten);
261
return
Number
.TryInt64ToHexStr((long)value,
Number
.GetHexBase(format.Symbol), format.PrecisionOrZero, destination, out bytesWritten);
306
Number
.TryUInt64ToDecStr((ulong)value, destination, out bytesWritten) :
307
Number
.TryNegativeInt64ToDecStr(value, format.PrecisionOrZero, "-"u8, destination, out bytesWritten);
314
Number
.TryUInt64ToDecStr((ulong)value, format.PrecisionOrZero, destination, out bytesWritten) :
315
Number
.TryNegativeInt64ToDecStr(value, format.PrecisionOrZero, "-"u8, destination, out bytesWritten);
318
return
Number
.TryInt64ToHexStr(value,
Number
.GetHexBase(format.Symbol), format.PrecisionOrZero, destination, out bytesWritten);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Decimal.cs (5)
50
Number
.NumberBuffer number = new
Number
.NumberBuffer(
Number
.NumberBufferKind.Decimal, stackalloc byte[
Number
.DecimalNumberBufferLength]);
67
if (!
Number
.TryNumberToDecimal(ref number, ref value))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Float.cs (11)
32
Number
.NumberBuffer number = new
Number
.NumberBuffer(
Number
.NumberBufferKind.FloatingPoint, stackalloc byte[
Number
.SingleNumberBufferLength]);
36
value =
Number
.NumberToFloat<float>(ref number);
65
Number
.NumberBuffer number = new
Number
.NumberBuffer(
Number
.NumberBufferKind.FloatingPoint, stackalloc byte[
Number
.DoubleNumberBufferLength]);
69
value =
Number
.NumberToFloat<double>(ref number);
79
private static bool TryParseNormalAsFloatingPoint(ReadOnlySpan<byte> source, ref
Number
.NumberBuffer number, out int bytesConsumed, char standardFormat)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Number.cs (1)
16
private static bool TryParseNumber(ReadOnlySpan<byte> source, ref
Number
.NumberBuffer number, out int bytesConsumed, ParseNumberOptions options, out bool textUsedExponentNotation)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Byte.cs (23)
111
return
Number
.ParseBinaryInteger<char, byte>(s, style, NumberFormatInfo.GetInstance(provider));
127
return
Number
.TryParseBinaryInteger(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
133
return
Number
.TryParseBinaryInteger(s, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
138
return
Number
.UInt32ToDecStr(m_value);
143
return
Number
.FormatUInt32(m_value, format, null);
148
return
Number
.UInt32ToDecStr(m_value);
153
return
Number
.FormatUInt32(m_value, format, provider);
158
return
Number
.TryFormatUInt32(m_value, format, provider, destination, out charsWritten);
164
return
Number
.TryFormatUInt32(m_value, format, provider, utf8Destination, out bytesWritten);
1105
return
Number
.TryParseBinaryInteger(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
1112
return
Number
.TryParseBinaryInteger(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
1119
return
Number
.TryParseBinaryInteger(utf8Text, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out bytesConsumed) ==
Number
.ParsingStatus.OK;
1187
return
Number
.ParseBinaryInteger<byte, byte>(utf8Text, style, NumberFormatInfo.GetInstance(provider));
1194
return
Number
.TryParseBinaryInteger(utf8Text, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Char.cs (1)
264
Number
.ThrowOverflowException<char>();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.cs (31)
484
return
Number
.FormatDecimal(this, null, NumberFormatInfo.CurrentInfo);
489
return
Number
.FormatDecimal(this, format, NumberFormatInfo.CurrentInfo);
494
return
Number
.FormatDecimal(this, null, NumberFormatInfo.GetInstance(provider));
499
return
Number
.FormatDecimal(this, format, NumberFormatInfo.GetInstance(provider));
504
return
Number
.TryFormatDecimal(this, format, NumberFormatInfo.GetInstance(provider), destination, out charsWritten);
510
return
Number
.TryFormatDecimal(this, format, NumberFormatInfo.GetInstance(provider), utf8Destination, out bytesWritten);
538
return
Number
.ParseDecimal(s, style, NumberFormatInfo.GetInstance(provider));
554
return
Number
.TryParseDecimal(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
560
return
Number
.TryParseDecimal(s, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
712
Number
.ThrowOverflowException<byte>();
715
if (temp != (byte)temp)
Number
.ThrowOverflowException<byte>();
733
Number
.ThrowOverflowException<sbyte>();
736
if (temp != (sbyte)temp)
Number
.ThrowOverflowException<sbyte>();
753
Number
.ThrowOverflowException<short>();
756
if (temp != (short)temp)
Number
.ThrowOverflowException<short>();
828
Number
.ThrowOverflowException<ushort>();
831
if (temp != (ushort)temp)
Number
.ThrowOverflowException<ushort>();
1780
return
Number
.TryParseDecimal(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
1787
return
Number
.TryParseDecimal(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
1794
return
Number
.TryParseDecimal(utf8Text, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out bytesConsumed) ==
Number
.ParsingStatus.OK;
1829
return
Number
.ParseDecimal(utf8Text, style, NumberFormatInfo.GetInstance(provider));
1836
return
Number
.TryParseDecimal(utf8Text, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.DecCalc.cs (19)
170
Number
.ThrowDecimalOverflowException();
600
Number
.ThrowDecimalOverflowException();
632
Number
.ThrowDecimalOverflowException();
657
Number
.ThrowDecimalOverflowException();
716
Number
.ThrowDecimalOverflowException();
747
Number
.ThrowDecimalOverflowException();
801
Number
.ThrowDecimalOverflowException();
927
Number
.ThrowDecimalOverflowException();
1092
Number
.ThrowDecimalOverflowException();
1171
Number
.ThrowDecimalOverflowException();
1206
Number
.ThrowDecimalOverflowException();
1622
Number
.ThrowDecimalOverflowException();
1662
Number
.ThrowDecimalOverflowException();
1731
/// <see cref="
Number
.ComputeFloat{TFloat}(long, ulong)"/>), which avoid the integer division that
1750
return TFloat.CreateSaturating((double)low64 /
Number
.Pow10DoubleTable[scale]);
1756
(int Exponent, ulong Mantissa) am =
Number
.ComputeFloat<TFloat>(-scale, low64);
1985
Number
.ThrowDecimalOverflowException();
2063
Number
.ThrowDecimalOverflowException();
2134
Number
.ThrowDecimalOverflowException();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Double.cs (18)
361
return
Number
.FormatFloat(m_value, null, NumberFormatInfo.CurrentInfo);
366
return
Number
.FormatFloat(m_value, format, NumberFormatInfo.CurrentInfo);
371
return
Number
.FormatFloat(m_value, null, NumberFormatInfo.GetInstance(provider));
376
return
Number
.FormatFloat(m_value, format, NumberFormatInfo.GetInstance(provider));
381
return
Number
.TryFormatFloat(m_value, format, NumberFormatInfo.GetInstance(provider), destination, out charsWritten);
387
return
Number
.TryFormatFloat(m_value, format, NumberFormatInfo.GetInstance(provider), utf8Destination, out bytesWritten);
416
return
Number
.ParseFloat<char, double>(s, style, NumberFormatInfo.GetInstance(provider));
432
return
Number
.TryParseFloat(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _);
438
return
Number
.TryParseFloat(s, style, NumberFormatInfo.GetInstance(provider), out result, out _);
1502
return
Number
.TryParseFloat(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed);
1509
return
Number
.TryParseFloat(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed);
1516
return
Number
.TryParseFloat(utf8Text, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out bytesConsumed);
2537
return
Number
.ParseFloat<byte, double>(utf8Text, style, NumberFormatInfo.GetInstance(provider));
2544
return
Number
.TryParseFloat(utf8Text, style, NumberFormatInfo.GetInstance(provider), out result, out _);
2557
static int IBinaryFloatParseAndFormatInfo<double>.NumberBufferLength =>
Number
.DoubleNumberBufferLength;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Enum.cs (5)
944
Number
.ParsingStatus status =
Number
.TryParseBinaryIntegerStyle(value, NumberStyle, numberFormat, out result, out _);
945
if (status ==
Number
.ParsingStatus.OK)
950
if (status !=
Number
.ParsingStatus.Overflow)
958
Number
.ThrowOverflowException<TUnderlying>();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (54)
178
Number
.WriteTwoDigits((uint)value, ptr);
185
Number
.WriteFourDigits((uint)value, ptr);
191
TChar* p =
Number
.UInt32ToDecChars(buffer + 16, (uint)value, minimumLength);
836
Number
.WriteTwoDigits((uint)offset.Hours, p);
844
Number
.WriteTwoDigits((uint)offset.Hours, p);
846
Number
.WriteTwoDigits((uint)offset.Minutes, p + 3);
890
Number
.WriteTwoDigits((uint)offset.Hours, hoursMinutes);
892
Number
.WriteTwoDigits((uint)offset.Minutes, hoursMinutes + 3);
1358
Number
.WriteTwoDigits((uint)hour, dest);
1360
Number
.WriteTwoDigits((uint)minute, dest + 3);
1362
Number
.WriteTwoDigits((uint)second, dest + 6);
1364
Number
.WriteDigits((uint)fraction, dest + 9, 7);
1386
Number
.WriteTwoDigits((uint)hour, dest);
1388
Number
.WriteTwoDigits((uint)minute, dest + 3);
1390
Number
.WriteTwoDigits((uint)second, dest + 6);
1413
Number
.WriteFourDigits((uint)year, dest);
1415
Number
.WriteTwoDigits((uint)month, dest + 5);
1417
Number
.WriteTwoDigits((uint)day, dest + 8);
1452
Number
.WriteTwoDigits((uint)day, dest + 5);
1459
Number
.WriteFourDigits((uint)year, dest + 12);
1505
Number
.WriteFourDigits((uint)year, dest);
1507
Number
.WriteTwoDigits((uint)month, dest + 5);
1509
Number
.WriteTwoDigits((uint)day, dest + 8);
1512
Number
.WriteTwoDigits((uint)hour, dest + 11);
1514
Number
.WriteTwoDigits((uint)minute, dest + 14);
1516
Number
.WriteTwoDigits((uint)second, dest + 17);
1518
Number
.WriteDigits((uint)tick, dest + 20, 7);
1534
Number
.WriteTwoDigits((uint)offsetHours, dest + 28);
1536
Number
.WriteTwoDigits((uint)offsetMinutes, dest + 31);
1565
Number
.WriteFourDigits((uint)year, dest);
1567
Number
.WriteTwoDigits((uint)month, dest + 5);
1569
Number
.WriteTwoDigits((uint)day, dest + 8);
1572
Number
.WriteTwoDigits((uint)hour, dest + 11);
1574
Number
.WriteTwoDigits((uint)minute, dest + 14);
1576
Number
.WriteTwoDigits((uint)second, dest + 17);
1605
Number
.WriteFourDigits((uint)year, dest);
1607
Number
.WriteTwoDigits((uint)month, dest + 5);
1609
Number
.WriteTwoDigits((uint)day, dest + 8);
1612
Number
.WriteTwoDigits((uint)hour, dest + 11);
1614
Number
.WriteTwoDigits((uint)minute, dest + 14);
1616
Number
.WriteTwoDigits((uint)second, dest + 17);
1659
Number
.WriteTwoDigits((uint)day, dest + 5);
1666
Number
.WriteFourDigits((uint)year, dest + 12);
1669
Number
.WriteTwoDigits((uint)hour, dest + 17);
1671
Number
.WriteTwoDigits((uint)minute, dest + 20);
1673
Number
.WriteTwoDigits((uint)second, dest + 23);
1712
Number
.WriteTwoDigits((uint)month, dest);
1714
Number
.WriteTwoDigits((uint)day, dest + 3);
1716
Number
.WriteFourDigits((uint)year, dest + 6);
1720
Number
.WriteTwoDigits((uint)hour, dest + 11);
1722
Number
.WriteTwoDigits((uint)minute, dest + 14);
1724
Number
.WriteTwoDigits((uint)second, dest + 17);
1739
Number
.WriteTwoDigits((uint)offsetHours, dest + 21);
1741
Number
.WriteTwoDigits((uint)offsetMinutes, dest + 24);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanFormat.cs (5)
245
Number
.WriteDigits(days, p, dayDigits);
254
Number
.WriteTwoDigits(hours, p);
262
Number
.WriteTwoDigits((uint)minutes, p);
265
Number
.WriteTwoDigits((uint)seconds, p);
285
Number
.WriteDigits(fraction, p, fractionDigits);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Guid.cs (4)
487
guidString =
Number
.SpanTrim(guidString); // Remove whitespace from beginning and end
594
if (
Number
.TryParseBinaryIntegerHexOrBinaryNumberStyle<TChar, uint,
Number
.HexParser<uint>>(guidString.Slice(28, 8), NumberStyles.AllowHexSpecifier, out uintTmp, out _) ==
Number
.ParsingStatus.OK) // _h, _i, _j, _k
src\runtime\src\libraries\System.Private.CoreLib\src\System\Half.cs (18)
379
return
Number
.ParseFloat<char, Half>(s, style, NumberFormatInfo.GetInstance(provider));
415
return
Number
.TryParseFloat(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _);
429
return
Number
.TryParseFloat(s, style, NumberFormatInfo.GetInstance(provider), out result, out _);
526
return
Number
.FormatFloat(this, null, NumberFormatInfo.CurrentInfo);
534
return
Number
.FormatFloat(this, format, NumberFormatInfo.CurrentInfo);
542
return
Number
.FormatFloat(this, null, NumberFormatInfo.GetInstance(provider));
550
return
Number
.FormatFloat(this, format, NumberFormatInfo.GetInstance(provider));
563
return
Number
.TryFormatFloat(this, format, NumberFormatInfo.GetInstance(provider), destination, out charsWritten);
569
return
Number
.TryFormatFloat(this, format, NumberFormatInfo.GetInstance(provider), utf8Destination, out bytesWritten);
2225
return
Number
.TryParseFloat(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed);
2232
return
Number
.TryParseFloat(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed);
2239
return
Number
.TryParseFloat(utf8Text, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out bytesConsumed);
2380
return
Number
.ParseFloat<byte, Half>(utf8Text, style, NumberFormatInfo.GetInstance(provider));
2387
return
Number
.TryParseFloat(utf8Text, style, NumberFormatInfo.GetInstance(provider), out result, out _);
2400
static int IBinaryFloatParseAndFormatInfo<Half>.NumberBufferLength =>
Number
.HalfNumberBufferLength;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int128.cs (23)
100
return
Number
.Int128ToDecStr(this);
105
return
Number
.FormatInt128(this, null, provider);
110
return
Number
.FormatInt128(this, format, null);
115
return
Number
.FormatInt128(this, format, provider);
120
return
Number
.TryFormatInt128(this, format, provider, destination, out charsWritten);
126
return
Number
.TryFormatInt128(this, format, provider, utf8Destination, out bytesWritten);
144
return
Number
.ParseBinaryInteger<char, Int128>(s, style, NumberFormatInfo.GetInstance(provider));
160
return
Number
.TryParseBinaryInteger(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
166
return
Number
.TryParseBinaryInteger(s, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
1913
return
Number
.TryParseBinaryInteger(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
1920
return
Number
.TryParseBinaryInteger(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
1927
return
Number
.TryParseBinaryInteger(utf8Text, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out bytesConsumed) ==
Number
.ParsingStatus.OK;
2118
return
Number
.ParseBinaryInteger<byte, Int128>(utf8Text, style, NumberFormatInfo.GetInstance(provider));
2125
return
Number
.TryParseBinaryInteger(utf8Text, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int16.cs (22)
100
return
Number
.Int32ToDecStr(m_value);
105
return
Number
.FormatInt32(m_value, 0, null, provider);
115
return
Number
.FormatInt32(m_value, 0x0000FFFF, format, provider);
120
return
Number
.TryFormatInt32(m_value, 0x0000FFFF, format, provider, destination, out charsWritten);
126
return
Number
.TryFormatInt32(m_value, 0x0000FFFF, format, provider, utf8Destination, out bytesWritten);
144
return
Number
.ParseBinaryInteger<char, short>(s, style, NumberFormatInfo.GetInstance(provider));
160
return
Number
.TryParseBinaryInteger(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
166
return
Number
.TryParseBinaryInteger(s, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
1304
return
Number
.TryParseBinaryInteger(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
1311
return
Number
.TryParseBinaryInteger(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
1318
return
Number
.TryParseBinaryInteger(utf8Text, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out bytesConsumed) ==
Number
.ParsingStatus.OK;
1393
return
Number
.ParseBinaryInteger<byte, short>(utf8Text, style, NumberFormatInfo.GetInstance(provider));
1400
return
Number
.TryParseBinaryInteger(utf8Text, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int32.cs (22)
116
return
Number
.Int32ToDecStr(m_value);
126
return
Number
.FormatInt32(m_value, 0, null, provider);
131
return
Number
.FormatInt32(m_value, ~0, format, provider);
136
return
Number
.TryFormatInt32(m_value, ~0, format, provider, destination, out charsWritten);
142
return
Number
.TryFormatInt32(m_value, ~0, format, provider, utf8Destination, out bytesWritten);
160
return
Number
.ParseBinaryInteger<char, int>(s, style, NumberFormatInfo.GetInstance(provider));
176
return
Number
.TryParseBinaryInteger(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
182
return
Number
.TryParseBinaryInteger(s, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
1355
return
Number
.TryParseBinaryInteger(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
1362
return
Number
.TryParseBinaryInteger(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
1369
return
Number
.TryParseBinaryInteger(utf8Text, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out bytesConsumed) ==
Number
.ParsingStatus.OK;
1444
return
Number
.ParseBinaryInteger<byte, int>(utf8Text, style, NumberFormatInfo.GetInstance(provider));
1451
return
Number
.TryParseBinaryInteger(utf8Text, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int64.cs (23)
113
return
Number
.Int64ToDecStr(m_value);
118
return
Number
.FormatInt64(m_value, null, provider);
123
return
Number
.FormatInt64(m_value, format, null);
128
return
Number
.FormatInt64(m_value, format, provider);
133
return
Number
.TryFormatInt64(m_value, format, provider, destination, out charsWritten);
139
return
Number
.TryFormatInt64(m_value, format, provider, utf8Destination, out bytesWritten);
157
return
Number
.ParseBinaryInteger<char, long>(s, style, NumberFormatInfo.GetInstance(provider));
173
return
Number
.TryParseBinaryInteger(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
179
return
Number
.TryParseBinaryInteger(s, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
1358
return
Number
.TryParseBinaryInteger(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
1365
return
Number
.TryParseBinaryInteger(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
1372
return
Number
.TryParseBinaryInteger(utf8Text, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out bytesConsumed) ==
Number
.ParsingStatus.OK;
1447
return
Number
.ParseBinaryInteger<byte, long>(utf8Text, style, NumberFormatInfo.GetInstance(provider));
1454
return
Number
.TryParseBinaryInteger(utf8Text, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
src\runtime\src\libraries\System.Private.CoreLib\src\System\IntPtr.cs (9)
1376
return
Number
.TryParseBinaryInteger(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out Unsafe.As<nint, nint_t>(ref result), out charsConsumed) ==
Number
.ParsingStatus.OK;
1384
return
Number
.TryParseBinaryInteger(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out Unsafe.As<nint, nint_t>(ref result), out charsConsumed) ==
Number
.ParsingStatus.OK;
1392
return
Number
.TryParseBinaryInteger(utf8Text, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out Unsafe.As<nint, nint_t>(ref result), out bytesConsumed) ==
Number
.ParsingStatus.OK;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Math.cs (2)
1430
if ((digits > maxFastRoundingDigits) || !
Number
.TryRoundToDecimalDigitsFast(value, digits, mode, out double rounded))
1432
rounded =
Number
.RoundToDecimalDigits<double>(value, digits, mode);
src\runtime\src\libraries\System.Private.CoreLib\src\System\MathF.cs (2)
454
if ((digits > maxFastRoundingDigits) || !
Number
.TryRoundToDecimalDigitsFast(x, digits, mode, out float rounded))
456
rounded =
Number
.RoundToDecimalDigits<float>(x, digits, mode);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Formatting.cs (1)
583
DecodedDecimalIeee754<TValue> unpackDecimal =
Number
.UnpackDecimalIeee754<TDecimal, TValue>(value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Parsing.cs (1)
151
static abstract TValue NumberToSignificand(ref
Number
.NumberBuffer number, int digits);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\BFloat16.cs (17)
275
return
Number
.ParseFloat<char, BFloat16>(s, style, NumberFormatInfo.GetInstance(provider));
311
return
Number
.TryParseFloat(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _);
325
return
Number
.TryParseFloat(s, style, NumberFormatInfo.GetInstance(provider), out result, out _);
388
public override string ToString() =>
Number
.FormatFloat(this, null, NumberFormatInfo.CurrentInfo);
395
return
Number
.FormatFloat(this, format, NumberFormatInfo.CurrentInfo);
403
return
Number
.FormatFloat(this, null, NumberFormatInfo.GetInstance(provider));
411
return
Number
.FormatFloat(this, format, NumberFormatInfo.GetInstance(provider));
424
return
Number
.TryFormatFloat(this, format, NumberFormatInfo.GetInstance(provider), destination, out charsWritten);
430
return
Number
.TryFormatFloat(this, format, NumberFormatInfo.GetInstance(provider), utf8Destination, out bytesWritten);
1948
return
Number
.TryParseFloat(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed);
1955
return
Number
.TryParseFloat(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed);
1962
return
Number
.TryParseFloat(utf8Text, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out bytesConsumed);
2101
return
Number
.ParseFloat<byte, BFloat16>(utf8Text, style, NumberFormatInfo.GetInstance(provider));
2108
return
Number
.TryParseFloat(utf8Text, style, NumberFormatInfo.GetInstance(provider), out result, out _);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal128.cs (176)
155
return
Number
.ParseDecimalIeee754<char, Decimal128, UInt128>(s, style, NumberFormatInfo.GetInstance(provider));
213
return
Number
.TryParseDecimalIeee754<char, Decimal128, UInt128>(s, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
227
return
Number
.TryParseDecimalIeee754<char, Decimal128, UInt128>(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
245
return
Number
.CompareDecimalIeee754<Decimal128, UInt128>(current, another);
253
return
Number
.CompareDecimalIeee754<Decimal128, UInt128>(current, another) == 0;
269
return
Number
.GetDecimalIeee754HashCode<Decimal128, UInt128>(new UInt128(_upper, _lower));
288
public static UInt128 EncodeDecimal(Decimal128 x) =>
Number
.EncodeDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower));
294
public static Decimal128 DecodeDecimal(UInt128 x) => new Decimal128(
Number
.DecodeDecimalIeee754<Decimal128, UInt128>(x));
301
return
Number
.FormatDecimalIeee754<Decimal128, UInt128>(new UInt128(_upper, _lower), null, NumberFormatInfo.CurrentInfo);
309
return
Number
.FormatDecimalIeee754<Decimal128, UInt128>(new UInt128(_upper, _lower), format, NumberFormatInfo.CurrentInfo);
317
return
Number
.FormatDecimalIeee754<Decimal128, UInt128>(new UInt128(_upper, _lower), null, NumberFormatInfo.GetInstance(provider));
325
return
Number
.FormatDecimalIeee754<Decimal128, UInt128>(new UInt128(_upper, _lower), format, NumberFormatInfo.GetInstance(provider));
331
return
Number
.TryFormatDecimalIeee754<Decimal128, UInt128, char>(new UInt128(_upper, _lower), format, NumberFormatInfo.GetInstance(provider), destination, out charsWritten);
337
return
Number
.TryFormatDecimalIeee754<Decimal128, UInt128, byte>(new UInt128(_upper, _lower), format, NumberFormatInfo.GetInstance(provider), utf8Destination, out bytesWritten);
355
UInt128 result =
Number
.AddDecimalIeee754<Decimal128, UInt128>(new UInt128(value._upper, value._lower), OneValue);
364
UInt128 result =
Number
.SubtractDecimalIeee754<Decimal128, UInt128>(new UInt128(value._upper, value._lower), OneValue);
374
UInt128 result =
Number
.AddDecimalIeee754<Decimal128, UInt128>(new UInt128(left._upper, left._lower), new UInt128(right._upper, right._lower));
384
UInt128 result =
Number
.SubtractDecimalIeee754<Decimal128, UInt128>(new UInt128(left._upper, left._lower), new UInt128(right._upper, right._lower));
394
UInt128 result =
Number
.MultiplyDecimalIeee754<Decimal128, UInt128>(new UInt128(left._upper, left._lower), new UInt128(right._upper, right._lower));
404
UInt128 result =
Number
.DivideDecimalIeee754<Decimal128, UInt128>(new UInt128(left._upper, left._lower), new UInt128(right._upper, right._lower));
414
UInt128 result =
Number
.RemainderDecimalIeee754<Decimal128, UInt128>(new UInt128(left._upper, left._lower), new UInt128(right._upper, right._lower));
425
public static explicit operator Decimal128(Int128 value) => new Decimal128(
Number
.ConvertIntegerToDecimalIeee754<Decimal128, UInt128, Int128>(value));
431
public static explicit operator Decimal128(UInt128 value) => new Decimal128(
Number
.ConvertIntegerToDecimalIeee754<Decimal128, UInt128, UInt128>(value));
436
public static explicit operator Decimal128(Half value) => new Decimal128(
Number
.ConvertFloatToDecimalIeee754<Half, Decimal128, UInt128>(value));
441
public static explicit operator Decimal128(float value) => new Decimal128(
Number
.ConvertFloatToDecimalIeee754<float, Decimal128, UInt128>(value));
446
public static explicit operator Decimal128(double value) => new Decimal128(
Number
.ConvertFloatToDecimalIeee754<double, Decimal128, UInt128>(value));
455
public static explicit operator byte(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, byte>(new UInt128(value._upper, value._lower), isChecked: false);
461
public static explicit operator checked byte(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, byte>(new UInt128(value._upper, value._lower), isChecked: true);
467
public static explicit operator sbyte(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, sbyte>(new UInt128(value._upper, value._lower), isChecked: false);
474
public static explicit operator checked sbyte(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, sbyte>(new UInt128(value._upper, value._lower), isChecked: true);
479
public static explicit operator char(Decimal128 value) => (char)
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, ushort>(new UInt128(value._upper, value._lower), isChecked: false);
485
public static explicit operator checked char(Decimal128 value) => (char)
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, ushort>(new UInt128(value._upper, value._lower), isChecked: true);
490
public static explicit operator short(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, short>(new UInt128(value._upper, value._lower), isChecked: false);
496
public static explicit operator checked short(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, short>(new UInt128(value._upper, value._lower), isChecked: true);
502
public static explicit operator ushort(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, ushort>(new UInt128(value._upper, value._lower), isChecked: false);
509
public static explicit operator checked ushort(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, ushort>(new UInt128(value._upper, value._lower), isChecked: true);
514
public static explicit operator int(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, int>(new UInt128(value._upper, value._lower), isChecked: false);
520
public static explicit operator checked int(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, int>(new UInt128(value._upper, value._lower), isChecked: true);
526
public static explicit operator uint(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, uint>(new UInt128(value._upper, value._lower), isChecked: false);
533
public static explicit operator checked uint(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, uint>(new UInt128(value._upper, value._lower), isChecked: true);
538
public static explicit operator nint(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, nint>(new UInt128(value._upper, value._lower), isChecked: false);
544
public static explicit operator checked nint(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, nint>(new UInt128(value._upper, value._lower), isChecked: true);
550
public static explicit operator nuint(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, nuint>(new UInt128(value._upper, value._lower), isChecked: false);
557
public static explicit operator checked nuint(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, nuint>(new UInt128(value._upper, value._lower), isChecked: true);
562
public static explicit operator long(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, long>(new UInt128(value._upper, value._lower), isChecked: false);
568
public static explicit operator checked long(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, long>(new UInt128(value._upper, value._lower), isChecked: true);
574
public static explicit operator ulong(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, ulong>(new UInt128(value._upper, value._lower), isChecked: false);
581
public static explicit operator checked ulong(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, ulong>(new UInt128(value._upper, value._lower), isChecked: true);
586
public static explicit operator Int128(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, Int128>(new UInt128(value._upper, value._lower), isChecked: false);
592
public static explicit operator checked Int128(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, Int128>(new UInt128(value._upper, value._lower), isChecked: true);
598
public static explicit operator UInt128(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, UInt128>(new UInt128(value._upper, value._lower), isChecked: false);
605
public static explicit operator checked UInt128(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, UInt128>(new UInt128(value._upper, value._lower), isChecked: true);
610
public static explicit operator Half(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToFloat<Decimal128, UInt128, Half>(new UInt128(value._upper, value._lower));
615
public static explicit operator float(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToFloat<Decimal128, UInt128, float>(new UInt128(value._upper, value._lower));
620
public static explicit operator double(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToFloat<Decimal128, UInt128, double>(new UInt128(value._upper, value._lower));
626
public static explicit operator decimal(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToDecimal<Decimal128, UInt128>(new UInt128(value._upper, value._lower));
635
public static implicit operator Decimal128(byte value) => new Decimal128(
Number
.ConvertIntegerToDecimalIeee754<Decimal128, UInt128, byte>(value));
641
public static implicit operator Decimal128(sbyte value) => new Decimal128(
Number
.ConvertIntegerToDecimalIeee754<Decimal128, UInt128, sbyte>(value));
646
public static implicit operator Decimal128(char value) => new Decimal128(
Number
.ConvertIntegerToDecimalIeee754<Decimal128, UInt128, ushort>(value));
651
public static implicit operator Decimal128(short value) => new Decimal128(
Number
.ConvertIntegerToDecimalIeee754<Decimal128, UInt128, short>(value));
657
public static implicit operator Decimal128(ushort value) => new Decimal128(
Number
.ConvertIntegerToDecimalIeee754<Decimal128, UInt128, ushort>(value));
662
public static implicit operator Decimal128(int value) => new Decimal128(
Number
.ConvertIntegerToDecimalIeee754<Decimal128, UInt128, int>(value));
668
public static implicit operator Decimal128(uint value) => new Decimal128(
Number
.ConvertIntegerToDecimalIeee754<Decimal128, UInt128, uint>(value));
673
public static implicit operator Decimal128(nint value) => new Decimal128(
Number
.ConvertIntegerToDecimalIeee754<Decimal128, UInt128, nint>(value));
679
public static implicit operator Decimal128(nuint value) => new Decimal128(
Number
.ConvertIntegerToDecimalIeee754<Decimal128, UInt128, nuint>(value));
684
public static implicit operator Decimal128(long value) => new Decimal128(
Number
.ConvertIntegerToDecimalIeee754<Decimal128, UInt128, long>(value));
690
public static implicit operator Decimal128(ulong value) => new Decimal128(
Number
.ConvertIntegerToDecimalIeee754<Decimal128, UInt128, ulong>(value));
695
public static implicit operator Decimal128(decimal value) => new Decimal128(
Number
.ConvertDecimalToDecimalIeee754<Decimal128, UInt128>(value));
703
return
Number
.EqualsDecimalIeee754<Decimal128, UInt128>(new UInt128(left._upper, left._lower), new UInt128(right._upper, right._lower));
721
return
Number
.LessThanDecimalIeee754<Decimal128, UInt128>(new UInt128(left._upper, left._lower), new UInt128(right._upper, right._lower));
730
return
Number
.GreaterThanDecimalIeee754<Decimal128, UInt128>(new UInt128(left._upper, left._lower), new UInt128(right._upper, right._lower));
739
return
Number
.LessThanOrEqualDecimalIeee754<Decimal128, UInt128>(new UInt128(left._upper, left._lower), new UInt128(right._upper, right._lower));
748
return
Number
.GreaterThanOrEqualDecimalIeee754<Decimal128, UInt128>(new UInt128(left._upper, left._lower), new UInt128(right._upper, right._lower));
759
return
Number
.TryParseDecimalIeee754<char, Decimal128, UInt128>(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
766
return
Number
.TryParseDecimalIeee754<char, Decimal128, UInt128>(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
773
return
Number
.TryParseDecimalIeee754<byte, Decimal128, UInt128>(utf8Text, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out bytesConsumed) ==
Number
.ParsingStatus.OK;
788
return
Number
.ParseDecimalIeee754<byte, Decimal128, UInt128>(utf8Text, style, NumberFormatInfo.GetInstance(provider));
795
public static bool TryParse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider, [MaybeNullWhen(false)] out Decimal128 result) =>
Number
.TryParseDecimalIeee754<byte, Decimal128, UInt128>(utf8Text, NumberStyles.Float | NumberStyles.AllowThousands, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
817
public static Decimal128 Ceiling(Decimal128 x) => new Decimal128(
Number
.RoundDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), 0, MidpointRounding.ToPositiveInfinity));
828
public static Decimal128 Floor(Decimal128 x) => new Decimal128(
Number
.RoundDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), 0, MidpointRounding.ToNegativeInfinity));
831
public static Decimal128 Round(Decimal128 x) => new Decimal128(
Number
.RoundDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), 0, MidpointRounding.ToEven));
834
public static Decimal128 Round(Decimal128 x, int digits) => new Decimal128(
Number
.RoundDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), digits, MidpointRounding.ToEven));
837
public static Decimal128 Round(Decimal128 x, MidpointRounding mode) => new Decimal128(
Number
.RoundDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), 0, mode));
840
public static Decimal128 Round(Decimal128 x, int digits, MidpointRounding mode) => new Decimal128(
Number
.RoundDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), digits, mode));
843
public static Decimal128 Truncate(Decimal128 x) => new Decimal128(
Number
.RoundDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), 0, MidpointRounding.ToZero));
851
int exponent =
Number
.UnpackDecimalIeee754<Decimal128, UInt128>(new UInt128(_upper, _lower)).UnbiasedExponent;
872
if (BinaryPrimitives.TryWriteInt32BigEndian(destination,
Number
.UnpackDecimalIeee754<Decimal128, UInt128>(new UInt128(_upper, _lower)).UnbiasedExponent))
885
if (BinaryPrimitives.TryWriteInt32LittleEndian(destination,
Number
.UnpackDecimalIeee754<Decimal128, UInt128>(new UInt128(_upper, _lower)).UnbiasedExponent))
898
if (BinaryPrimitives.TryWriteUInt128BigEndian(destination,
Number
.UnpackDecimalIeee754<Decimal128, UInt128>(new UInt128(_upper, _lower)).Significand))
911
if (BinaryPrimitives.TryWriteUInt128LittleEndian(destination,
Number
.UnpackDecimalIeee754<Decimal128, UInt128>(new UInt128(_upper, _lower)).Significand))
926
public static Decimal128 Acos(Decimal128 x) => new Decimal128(
Number
.AcosDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
929
public static Decimal128 AcosPi(Decimal128 x) => new Decimal128(
Number
.AcosPiDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
932
public static Decimal128 Acosh(Decimal128 x) => new Decimal128(
Number
.AcoshDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
935
public static Decimal128 Asin(Decimal128 x) => new Decimal128(
Number
.AsinDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
938
public static Decimal128 AsinPi(Decimal128 x) => new Decimal128(
Number
.AsinPiDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
941
public static Decimal128 Asinh(Decimal128 x) => new Decimal128(
Number
.AsinhDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
944
public static Decimal128 Atan(Decimal128 x) => new Decimal128(
Number
.AtanDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
947
public static Decimal128 Atan2(Decimal128 y, Decimal128 x) => new Decimal128(
Number
.Atan2DecimalIeee754<Decimal128, UInt128>(new UInt128(y._upper, y._lower), new UInt128(x._upper, x._lower)));
950
public static Decimal128 Atan2Pi(Decimal128 y, Decimal128 x) => new Decimal128(
Number
.Atan2PiDecimalIeee754<Decimal128, UInt128>(new UInt128(y._upper, y._lower), new UInt128(x._upper, x._lower)));
953
public static Decimal128 AtanPi(Decimal128 x) => new Decimal128(
Number
.AtanPiDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
956
public static Decimal128 Atanh(Decimal128 x) => new Decimal128(
Number
.AtanhDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
959
public static Decimal128 BitDecrement(Decimal128 x) => new Decimal128(
Number
.BitDecrementDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
962
public static Decimal128 BitIncrement(Decimal128 x) => new Decimal128(
Number
.BitIncrementDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
965
public static Decimal128 Cbrt(Decimal128 x) => new Decimal128(
Number
.CbrtDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
968
public static Decimal128 Cos(Decimal128 x) => new Decimal128(
Number
.CosDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
971
public static Decimal128 CosPi(Decimal128 x) => new Decimal128(
Number
.CosPiDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
974
public static Decimal128 Cosh(Decimal128 x) => new Decimal128(
Number
.CoshDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
977
public static Decimal128 DegreesToRadians(Decimal128 degrees) => new Decimal128(
Number
.MultiplyByWideConstantDecimalIeee754<Decimal128, UInt128>(new UInt128(degrees._upper, degrees._lower), DegreesToRadiansHead, DegreesToRadiansTail, DegreesToRadiansExponent));
980
public static Decimal128 Exp(Decimal128 x) => new Decimal128(
Number
.ExpDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
983
public static Decimal128 Exp10(Decimal128 x) => new Decimal128(
Number
.Exp10DecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
986
public static Decimal128 Exp10M1(Decimal128 x) => new Decimal128(
Number
.Exp10M1DecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
989
public static Decimal128 Exp2(Decimal128 x) => new Decimal128(
Number
.Exp2DecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
992
public static Decimal128 Exp2M1(Decimal128 x) => new Decimal128(
Number
.Exp2M1DecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
995
public static Decimal128 ExpM1(Decimal128 x) => new Decimal128(
Number
.ExpM1DecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
998
public static Decimal128 FusedMultiplyAdd(Decimal128 left, Decimal128 right, Decimal128 addend) => new Decimal128(
Number
.FusedMultiplyAddDecimalIeee754<Decimal128, UInt128>(new UInt128(left._upper, left._lower), new UInt128(right._upper, right._lower), new UInt128(addend._upper, addend._lower)));
1001
public static Decimal128 Hypot(Decimal128 x, Decimal128 y) => new Decimal128(
Number
.HypotDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), new UInt128(y._upper, y._lower)));
1004
public static Decimal128 Ieee754Remainder(Decimal128 left, Decimal128 right) => new Decimal128(
Number
.Ieee754RemainderDecimalIeee754<Decimal128, UInt128>(new UInt128(left._upper, left._lower), new UInt128(right._upper, right._lower)));
1007
public static int ILogB(Decimal128 x) =>
Number
.ILogBDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower));
1013
public static Decimal128 Log(Decimal128 x) => new Decimal128(
Number
.LogDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
1016
public static Decimal128 Log(Decimal128 x, Decimal128 newBase) => new Decimal128(
Number
.LogDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), new UInt128(newBase._upper, newBase._lower)));
1019
public static Decimal128 Log10(Decimal128 x) => new Decimal128(
Number
.Log10DecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
1022
public static Decimal128 Log10P1(Decimal128 x) => new Decimal128(
Number
.Log10P1DecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
1025
public static Decimal128 Log2(Decimal128 x) => new Decimal128(
Number
.Log2DecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
1028
public static Decimal128 Log2P1(Decimal128 x) => new Decimal128(
Number
.Log2P1DecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
1031
public static Decimal128 LogP1(Decimal128 x) => new Decimal128(
Number
.LogP1DecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
1034
public static Decimal128 Pow(Decimal128 x, Decimal128 y) => new Decimal128(
Number
.PowDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), new UInt128(y._upper, y._lower)));
1037
public static Decimal128 RadiansToDegrees(Decimal128 radians) => new Decimal128(
Number
.MultiplyByWideConstantDecimalIeee754<Decimal128, UInt128>(new UInt128(radians._upper, radians._lower), RadiansToDegreesHead, RadiansToDegreesTail, RadiansToDegreesExponent));
1046
public static Decimal128 RootN(Decimal128 x, int n) => new Decimal128(
Number
.RootNDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), n));
1049
public static Decimal128 ScaleB(Decimal128 x, int n) => new Decimal128(
Number
.ScaleBDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), n));
1052
public static Decimal128 Sin(Decimal128 x) => new Decimal128(
Number
.SinDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
1057
(UInt128 sin, UInt128 cos) =
Number
.SinCosDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower));
1064
(UInt128 sin, UInt128 cos) =
Number
.SinCosPiDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower));
1069
public static Decimal128 SinPi(Decimal128 x) => new Decimal128(
Number
.SinPiDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
1072
public static Decimal128 Sinh(Decimal128 x) => new Decimal128(
Number
.SinhDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
1075
public static Decimal128 Sqrt(Decimal128 x) => new Decimal128(
Number
.SqrtDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
1078
public static Decimal128 Tan(Decimal128 x) => new Decimal128(
Number
.TanDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
1081
public static Decimal128 TanPi(Decimal128 x) => new Decimal128(
Number
.TanPiDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
1084
public static Decimal128 Tanh(Decimal128 x) => new Decimal128(
Number
.TanhDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
1090
public static Decimal128 Quantize(Decimal128 x, Decimal128 y) => new Decimal128(
Number
.QuantizeDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), new UInt128(y._upper, y._lower)));
1095
public static Decimal128 GetQuantum(Decimal128 x) => new Decimal128(
Number
.QuantumDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
1101
public static bool HaveSameQuantum(Decimal128 x, Decimal128 y) =>
Number
.SameQuantumDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), new UInt128(y._upper, y._lower));
1106
public static Decimal128 Abs(Decimal128 value) => new Decimal128(
Number
.AbsDecimalIeee754<Decimal128, UInt128>(new UInt128(value._upper, value._lower)));
1151
public static bool IsInteger(Decimal128 value) =>
Number
.IsIntegerDecimalIeee754<Decimal128, UInt128>(new UInt128(value._upper, value._lower));
1156
public static bool IsEvenInteger(Decimal128 value) =>
Number
.IsEvenIntegerDecimalIeee754<Decimal128, UInt128>(new UInt128(value._upper, value._lower));
1161
public static bool IsOddInteger(Decimal128 value) =>
Number
.IsOddIntegerDecimalIeee754<Decimal128, UInt128>(new UInt128(value._upper, value._lower));
1166
public static bool IsNormal(Decimal128 value) =>
Number
.IsNormalDecimalIeee754<Decimal128, UInt128>(new UInt128(value._upper, value._lower));
1171
public static bool IsSubnormal(Decimal128 value) =>
Number
.IsSubnormalDecimalIeee754<Decimal128, UInt128>(new UInt128(value._upper, value._lower));
1177
public static Decimal128 MaxMagnitude(Decimal128 x, Decimal128 y) => new Decimal128(
Number
.MaxMagnitudeDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), new UInt128(y._upper, y._lower)));
1183
public static Decimal128 MaxMagnitudeNumber(Decimal128 x, Decimal128 y) => new Decimal128(
Number
.MaxMagnitudeNumberDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), new UInt128(y._upper, y._lower)));
1189
public static Decimal128 MinMagnitude(Decimal128 x, Decimal128 y) => new Decimal128(
Number
.MinMagnitudeDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), new UInt128(y._upper, y._lower)));
1195
public static Decimal128 MinMagnitudeNumber(Decimal128 x, Decimal128 y) => new Decimal128(
Number
.MinMagnitudeNumberDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), new UInt128(y._upper, y._lower)));
1238
public static Decimal128 CopySign(Decimal128 value, Decimal128 sign) => new Decimal128(
Number
.CopySignDecimalIeee754<Decimal128, UInt128>(new UInt128(value._upper, value._lower), new UInt128(sign._upper, sign._lower)));
1244
public static Decimal128 Max(Decimal128 x, Decimal128 y) => new Decimal128(
Number
.MaxDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), new UInt128(y._upper, y._lower)));
1250
public static Decimal128 MaxNative(Decimal128 x, Decimal128 y) => new Decimal128(
Number
.MaxNativeDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), new UInt128(y._upper, y._lower)));
1256
public static Decimal128 MaxNumber(Decimal128 x, Decimal128 y) => new Decimal128(
Number
.MaxNumberDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), new UInt128(y._upper, y._lower)));
1262
public static Decimal128 Min(Decimal128 x, Decimal128 y) => new Decimal128(
Number
.MinDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), new UInt128(y._upper, y._lower)));
1268
public static Decimal128 MinNative(Decimal128 x, Decimal128 y) => new Decimal128(
Number
.MinNativeDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), new UInt128(y._upper, y._lower)));
1274
public static Decimal128 MinNumber(Decimal128 x, Decimal128 y) => new Decimal128(
Number
.MinNumberDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), new UInt128(y._upper, y._lower)));
1280
public static int Sign(Decimal128 value) =>
Number
.SignDecimalIeee754<Decimal128, UInt128>(new UInt128(value._upper, value._lower));
1286
static bool INumberBase<Decimal128>.IsCanonical(Decimal128 value) =>
Number
.IsCanonicalDecimalIeee754<Decimal128, UInt128>(new UInt128(value._upper, value._lower), nanReservedMask: new UInt128(0x01FF_C000_0000_0000, 0x0000_0000_0000_0000), nanPayloadMask: NaNPayloadMask, maxNaNPayload: new UInt128(0x0000_314D_C644_8D93, 0x38C1_5B09_FFFF_FFFF));
1295
static bool INumberBase<Decimal128>.IsZero(Decimal128 value) =>
Number
.IsZeroDecimalIeee754<Decimal128, UInt128>(new UInt128(value._upper, value._lower));
1769
return
Number
.UInt128ToDecStr(significand);
1772
static unsafe UInt128 IDecimalIeee754ParseAndFormatInfo<Decimal128, UInt128>.NumberToSignificand(ref
Number
.NumberBuffer number, int digits)
1776
return
Number
.DigitsToUInt64(number.DigitsPtr, digits);
1780
Number
.AccumulateDecimalDigitsIntoBigInteger(ref number, 0, (uint)digits, out
Number
.BigInteger result);
1801
static int IDecimalIeee754ParseAndFormatInfo<Decimal128, UInt128>.BufferLength =>
Number
.Decimal128NumberBufferLength;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal32.cs (179)
147
return
Number
.ParseDecimalIeee754<char, Decimal32, uint>(s, style, NumberFormatInfo.GetInstance(provider));
205
return
Number
.TryParseDecimalIeee754<char, Decimal32, uint>(s, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
219
return
Number
.TryParseDecimalIeee754<char, Decimal32, uint>(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
235
return
Number
.CompareDecimalIeee754<Decimal32, uint>(_value, i._value);
241
return
Number
.CompareDecimalIeee754<Decimal32, uint>(_value, other._value);
247
return
Number
.CompareDecimalIeee754<Decimal32, uint>(_value, other._value) == 0;
263
return
Number
.GetDecimalIeee754HashCode<Decimal32, uint>(_value);
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);
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));
490
public static explicit operator byte(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, byte>(value._value, isChecked: false);
496
public static explicit operator checked byte(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, byte>(value._value, isChecked: true);
502
public static explicit operator sbyte(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, sbyte>(value._value, isChecked: false);
509
public static explicit operator checked sbyte(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, sbyte>(value._value, isChecked: true);
514
public static explicit operator char(Decimal32 value) => (char)
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, ushort>(value._value, isChecked: false);
520
public static explicit operator checked char(Decimal32 value) => (char)
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, ushort>(value._value, isChecked: true);
525
public static explicit operator short(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, short>(value._value, isChecked: false);
531
public static explicit operator checked short(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, short>(value._value, isChecked: true);
537
public static explicit operator ushort(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, ushort>(value._value, isChecked: false);
544
public static explicit operator checked ushort(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, ushort>(value._value, isChecked: true);
549
public static explicit operator int(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, int>(value._value, isChecked: false);
555
public static explicit operator checked int(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, int>(value._value, isChecked: true);
561
public static explicit operator uint(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, uint>(value._value, isChecked: false);
568
public static explicit operator checked uint(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, uint>(value._value, isChecked: true);
573
public static explicit operator nint(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, nint>(value._value, isChecked: false);
579
public static explicit operator checked nint(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, nint>(value._value, isChecked: true);
585
public static explicit operator nuint(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, nuint>(value._value, isChecked: false);
592
public static explicit operator checked nuint(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, nuint>(value._value, isChecked: true);
597
public static explicit operator long(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, long>(value._value, isChecked: false);
603
public static explicit operator checked long(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, long>(value._value, isChecked: true);
609
public static explicit operator ulong(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, ulong>(value._value, isChecked: false);
616
public static explicit operator checked ulong(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, ulong>(value._value, isChecked: true);
621
public static explicit operator Int128(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, Int128>(value._value, isChecked: false);
627
public static explicit operator checked Int128(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, Int128>(value._value, isChecked: true);
633
public static explicit operator UInt128(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, UInt128>(value._value, isChecked: false);
640
public static explicit operator checked UInt128(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, UInt128>(value._value, isChecked: true);
645
public static explicit operator Half(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToFloat<Decimal32, uint, Half>(value._value);
650
public static explicit operator float(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToFloat<Decimal32, uint, float>(value._value);
655
public static explicit operator double(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToFloat<Decimal32, uint, double>(value._value);
661
public static explicit operator decimal(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToDecimal<Decimal32, uint>(value._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));
701
public static implicit operator Decimal64(Decimal32 value) => new Decimal64(
Number
.ConvertDecimalIeee754<Decimal32, uint, Decimal64, ulong>(value._value));
706
public static implicit operator Decimal128(Decimal32 value) => new Decimal128(
Number
.ConvertDecimalIeee754<Decimal32, uint, Decimal128, UInt128>(value._value));
714
return
Number
.EqualsDecimalIeee754<Decimal32, uint>(left._value, right._value);
732
return
Number
.LessThanDecimalIeee754<Decimal32, uint>(left._value, right._value);
741
return
Number
.GreaterThanDecimalIeee754<Decimal32, uint>(left._value, right._value);
750
return
Number
.LessThanOrEqualDecimalIeee754<Decimal32, uint>(left._value, right._value);
759
return
Number
.GreaterThanOrEqualDecimalIeee754<Decimal32, uint>(left._value, right._value);
770
return
Number
.TryParseDecimalIeee754<char, Decimal32, uint>(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
777
return
Number
.TryParseDecimalIeee754<char, Decimal32, uint>(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
784
return
Number
.TryParseDecimalIeee754<byte, Decimal32, uint>(utf8Text, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out bytesConsumed) ==
Number
.ParsingStatus.OK;
799
return
Number
.ParseDecimalIeee754<byte, Decimal32, uint>(utf8Text, style, NumberFormatInfo.GetInstance(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;
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));
862
int exponent =
Number
.UnpackDecimalIeee754<Decimal32, uint>(_value).UnbiasedExponent;
883
if (BinaryPrimitives.TryWriteInt32BigEndian(destination,
Number
.UnpackDecimalIeee754<Decimal32, uint>(_value).UnbiasedExponent))
896
if (BinaryPrimitives.TryWriteInt32LittleEndian(destination,
Number
.UnpackDecimalIeee754<Decimal32, uint>(_value).UnbiasedExponent))
909
if (BinaryPrimitives.TryWriteUInt32BigEndian(destination,
Number
.UnpackDecimalIeee754<Decimal32, uint>(_value).Significand))
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);
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));
1068
(uint sin, uint cos) =
Number
.SinCosDecimalIeee754<Decimal32, uint>(x._value);
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));
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));
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);
1297
static bool INumberBase<Decimal32>.IsCanonical(Decimal32 value) =>
Number
.IsCanonicalDecimalIeee754<Decimal32, uint>(value._value, nanReservedMask: 0x01F0_0000, nanPayloadMask: NaNPayloadMask, maxNaNPayload: 999_999);
1306
static bool INumberBase<Decimal32>.IsZero(Decimal32 value) =>
Number
.IsZeroDecimalIeee754<Decimal32, uint>(value._value);
1746
static int IDecimalIeee754ParseAndFormatInfo<Decimal32, uint>.BufferLength =>
Number
.Decimal32NumberBufferLength;
1750
return
Number
.UInt32ToDecStr(significand);
1753
static unsafe uint IDecimalIeee754ParseAndFormatInfo<Decimal32, uint>.NumberToSignificand(ref
Number
.NumberBuffer number, int digits)
1755
return
Number
.DigitsToUInt32(number.DigitsPtr, digits);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal64.cs (176)
156
return
Number
.ParseDecimalIeee754<char, Decimal64, ulong>(s, style, NumberFormatInfo.GetInstance(provider));
214
return
Number
.TryParseDecimalIeee754<char, Decimal64, ulong>(s, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
228
return
Number
.TryParseDecimalIeee754<char, Decimal64, ulong>(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
244
return
Number
.CompareDecimalIeee754<Decimal64, ulong>(_value, other._value);
250
return
Number
.CompareDecimalIeee754<Decimal64, ulong>(_value, other._value) == 0;
266
return
Number
.GetDecimalIeee754HashCode<Decimal64, ulong>(_value);
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);
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));
477
public static explicit operator byte(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, byte>(value._value, isChecked: false);
483
public static explicit operator checked byte(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, byte>(value._value, isChecked: true);
489
public static explicit operator sbyte(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, sbyte>(value._value, isChecked: false);
496
public static explicit operator checked sbyte(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, sbyte>(value._value, isChecked: true);
501
public static explicit operator char(Decimal64 value) => (char)
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, ushort>(value._value, isChecked: false);
507
public static explicit operator checked char(Decimal64 value) => (char)
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, ushort>(value._value, isChecked: true);
512
public static explicit operator short(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, short>(value._value, isChecked: false);
518
public static explicit operator checked short(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, short>(value._value, isChecked: true);
524
public static explicit operator ushort(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, ushort>(value._value, isChecked: false);
531
public static explicit operator checked ushort(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, ushort>(value._value, isChecked: true);
536
public static explicit operator int(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, int>(value._value, isChecked: false);
542
public static explicit operator checked int(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, int>(value._value, isChecked: true);
548
public static explicit operator uint(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, uint>(value._value, isChecked: false);
555
public static explicit operator checked uint(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, uint>(value._value, isChecked: true);
560
public static explicit operator nint(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, nint>(value._value, isChecked: false);
566
public static explicit operator checked nint(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, nint>(value._value, isChecked: true);
572
public static explicit operator nuint(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, nuint>(value._value, isChecked: false);
579
public static explicit operator checked nuint(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, nuint>(value._value, isChecked: true);
584
public static explicit operator long(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, long>(value._value, isChecked: false);
590
public static explicit operator checked long(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, long>(value._value, isChecked: true);
596
public static explicit operator ulong(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, ulong>(value._value, isChecked: false);
603
public static explicit operator checked ulong(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, ulong>(value._value, isChecked: true);
608
public static explicit operator Int128(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, Int128>(value._value, isChecked: false);
614
public static explicit operator checked Int128(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, Int128>(value._value, isChecked: true);
620
public static explicit operator UInt128(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, UInt128>(value._value, isChecked: false);
627
public static explicit operator checked UInt128(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, UInt128>(value._value, isChecked: true);
632
public static explicit operator Half(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToFloat<Decimal64, ulong, Half>(value._value);
637
public static explicit operator float(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToFloat<Decimal64, ulong, float>(value._value);
642
public static explicit operator double(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToFloat<Decimal64, ulong, double>(value._value);
648
public static explicit operator decimal(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToDecimal<Decimal64, ulong>(value._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));
699
public static implicit operator Decimal128(Decimal64 value) => new Decimal128(
Number
.ConvertDecimalIeee754<Decimal64, ulong, Decimal128, UInt128>(value._value));
707
return
Number
.EqualsDecimalIeee754<Decimal64, ulong>(left._value, right._value);
725
return
Number
.LessThanDecimalIeee754<Decimal64, ulong>(left._value, right._value);
734
return
Number
.GreaterThanDecimalIeee754<Decimal64, ulong>(left._value, right._value);
743
return
Number
.LessThanOrEqualDecimalIeee754<Decimal64, ulong>(left._value, right._value);
752
return
Number
.GreaterThanOrEqualDecimalIeee754<Decimal64, ulong>(left._value, right._value);
763
return
Number
.TryParseDecimalIeee754<char, Decimal64, ulong>(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
770
return
Number
.TryParseDecimalIeee754<char, Decimal64, ulong>(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
777
return
Number
.TryParseDecimalIeee754<byte, Decimal64, ulong>(utf8Text, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out bytesConsumed) ==
Number
.ParsingStatus.OK;
792
return
Number
.ParseDecimalIeee754<byte, Decimal64, ulong>(utf8Text, style, NumberFormatInfo.GetInstance(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;
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));
855
int exponent =
Number
.UnpackDecimalIeee754<Decimal64, ulong>(_value).UnbiasedExponent;
876
if (BinaryPrimitives.TryWriteInt32BigEndian(destination,
Number
.UnpackDecimalIeee754<Decimal64, ulong>(_value).UnbiasedExponent))
889
if (BinaryPrimitives.TryWriteInt32LittleEndian(destination,
Number
.UnpackDecimalIeee754<Decimal64, ulong>(_value).UnbiasedExponent))
902
if (BinaryPrimitives.TryWriteUInt64BigEndian(destination,
Number
.UnpackDecimalIeee754<Decimal64, ulong>(_value).Significand))
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);
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));
1061
(ulong sin, ulong cos) =
Number
.SinCosDecimalIeee754<Decimal64, ulong>(x._value);
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));
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));
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);
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);
1299
static bool INumberBase<Decimal64>.IsZero(Decimal64 value) =>
Number
.IsZeroDecimalIeee754<Decimal64, ulong>(value._value);
1739
static int IDecimalIeee754ParseAndFormatInfo<Decimal64, ulong>.BufferLength =>
Number
.Decimal64NumberBufferLength;
1743
return
Number
.UInt64ToDecStr(significand);
1746
static unsafe ulong IDecimalIeee754ParseAndFormatInfo<Decimal64, ulong>.NumberToSignificand(ref
Number
.NumberBuffer number, int digits)
1748
return
Number
.DigitsToUInt64(number.DigitsPtr, digits);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\TotalOrderIeee754Comparer.cs (5)
367
int result =
Number
.CompareDecimalIeee754<TDecimal, TValue>(xBits, yBits);
376
Number
.DecodedDecimalIeee754<TValue> x =
Number
.UnpackDecimalIeee754<TDecimal, TValue>(xBits);
377
Number
.DecodedDecimalIeee754<TValue> y =
Number
.UnpackDecimalIeee754<TDecimal, TValue>(yBits);
src\runtime\src\libraries\System.Private.CoreLib\src\System\ParseNumbers.cs (12)
94
Number
.ThrowOverflowException<long>();
185
Number
.ThrowOverflowException<sbyte>();
190
Number
.ThrowOverflowException<short>();
194
Number
.ThrowOverflowException<int>();
228
Number
.ThrowOverflowException<long>();
237
Number
.ThrowOverflowException<long>();
255
Number
.ThrowOverflowException<ulong>();
262
Number
.ThrowOverflowException<ulong>();
289
Number
.ThrowOverflowException<int>();
296
Number
.ThrowOverflowException<int>();
314
Number
.ThrowOverflowException<uint>();
321
Number
.ThrowOverflowException<uint>();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NFloat.cs (6)
1721
return
Number
.TryParseFloat(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out Unsafe.As<NFloat, NativeType>(ref result), out charsConsumed);
1729
return
Number
.TryParseFloat(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out Unsafe.As<NFloat, NativeType>(ref result), out charsConsumed);
1737
return
Number
.TryParseFloat(utf8Text, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out Unsafe.As<NFloat, NativeType>(ref result), out bytesConsumed);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SByte.cs (22)
103
return
Number
.Int32ToDecStr(m_value);
113
return
Number
.FormatInt32(m_value, 0, null, provider);
118
return
Number
.FormatInt32(m_value, 0x000000FF, format, provider);
123
return
Number
.TryFormatInt32(m_value, 0x000000FF, format, provider, destination, out charsWritten);
129
return
Number
.TryFormatInt32(m_value, 0x000000FF, format, provider, utf8Destination, out bytesWritten);
147
return
Number
.ParseBinaryInteger<char, sbyte>(s, style, NumberFormatInfo.GetInstance(provider));
163
return
Number
.TryParseBinaryInteger(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
169
return
Number
.TryParseBinaryInteger(s, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
1283
return
Number
.TryParseBinaryInteger(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
1290
return
Number
.TryParseBinaryInteger(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
1297
return
Number
.TryParseBinaryInteger(utf8Text, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out bytesConsumed) ==
Number
.ParsingStatus.OK;
1372
return
Number
.ParseBinaryInteger<byte, sbyte>(utf8Text, style, NumberFormatInfo.GetInstance(provider));
1379
return
Number
.TryParseBinaryInteger(utf8Text, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Single.cs (18)
354
return
Number
.FormatFloat(m_value, null, NumberFormatInfo.CurrentInfo);
359
return
Number
.FormatFloat(m_value, null, NumberFormatInfo.GetInstance(provider));
364
return
Number
.FormatFloat(m_value, format, NumberFormatInfo.CurrentInfo);
369
return
Number
.FormatFloat(m_value, format, NumberFormatInfo.GetInstance(provider));
374
return
Number
.TryFormatFloat(m_value, format, NumberFormatInfo.GetInstance(provider), destination, out charsWritten);
380
return
Number
.TryFormatFloat(m_value, format, NumberFormatInfo.GetInstance(provider), utf8Destination, out bytesWritten);
409
return
Number
.ParseFloat<char, float>(s, style, NumberFormatInfo.GetInstance(provider));
425
return
Number
.TryParseFloat(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _);
431
return
Number
.TryParseFloat(s, style, NumberFormatInfo.GetInstance(provider), out result, out _);
1519
return
Number
.TryParseFloat(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed);
1526
return
Number
.TryParseFloat(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed);
1533
return
Number
.TryParseFloat(utf8Text, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out bytesConsumed);
2225
return
Number
.ParseFloat<byte, float>(utf8Text, style, NumberFormatInfo.GetInstance(provider));
2232
return
Number
.TryParseFloat(utf8Text, style, NumberFormatInfo.GetInstance(provider), out result, out _);
2245
static int IBinaryFloatParseAndFormatInfo<float>.NumberBufferLength =>
Number
.SingleNumberBufferLength;
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt128.cs (24)
102
return
Number
.UInt128ToDecStr(this);
107
return
Number
.FormatUInt128(this, null, provider);
112
return
Number
.FormatUInt128(this, format, null);
117
return
Number
.FormatUInt128(this, format, provider);
122
return
Number
.TryFormatUInt128(this, format, provider, destination, out charsWritten);
128
return
Number
.TryFormatUInt128(this, format, provider, utf8Destination, out bytesWritten);
146
return
Number
.ParseBinaryInteger<char, UInt128>(s, style, NumberFormatInfo.GetInstance(provider));
162
return
Number
.TryParseBinaryInteger(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
168
return
Number
.TryParseBinaryInteger(s, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
221
Number
.ThrowDecimalOverflowException();
2034
return
Number
.TryParseBinaryInteger(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
2041
return
Number
.TryParseBinaryInteger(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
2048
return
Number
.TryParseBinaryInteger(utf8Text, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out bytesConsumed) ==
Number
.ParsingStatus.OK;
2196
return
Number
.ParseBinaryInteger<byte, UInt128>(utf8Text, style, NumberFormatInfo.GetInstance(provider));
2203
return
Number
.TryParseBinaryInteger(utf8Text, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt16.cs (23)
95
return
Number
.UInt32ToDecStr(m_value);
100
return
Number
.UInt32ToDecStr(m_value);
105
return
Number
.FormatUInt32(m_value, format, null);
110
return
Number
.FormatUInt32(m_value, format, provider);
115
return
Number
.TryFormatUInt32(m_value, format, provider, destination, out charsWritten);
121
return
Number
.TryFormatUInt32(m_value, format, provider, utf8Destination, out bytesWritten);
139
return
Number
.ParseBinaryInteger<char, ushort>(s, style, NumberFormatInfo.GetInstance(provider));
155
return
Number
.TryParseBinaryInteger(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
161
return
Number
.TryParseBinaryInteger(s, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
1110
return
Number
.TryParseBinaryInteger(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
1117
return
Number
.TryParseBinaryInteger(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
1124
return
Number
.TryParseBinaryInteger(utf8Text, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out bytesConsumed) ==
Number
.ParsingStatus.OK;
1192
return
Number
.ParseBinaryInteger<byte, ushort>(utf8Text, style, NumberFormatInfo.GetInstance(provider));
1199
return
Number
.TryParseBinaryInteger(utf8Text, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt32.cs (23)
111
return
Number
.UInt32ToDecStr(m_value);
116
return
Number
.UInt32ToDecStr(m_value);
121
return
Number
.FormatUInt32(m_value, format, null);
126
return
Number
.FormatUInt32(m_value, format, provider);
131
return
Number
.TryFormatUInt32(m_value, format, provider, destination, out charsWritten);
137
return
Number
.TryFormatUInt32(m_value, format, provider, utf8Destination, out bytesWritten);
155
return
Number
.ParseBinaryInteger<char, uint>(s, style, NumberFormatInfo.GetInstance(provider));
171
return
Number
.TryParseBinaryInteger(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
177
return
Number
.TryParseBinaryInteger(s, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
1181
return
Number
.TryParseBinaryInteger(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
1188
return
Number
.TryParseBinaryInteger(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
1195
return
Number
.TryParseBinaryInteger(utf8Text, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out bytesConsumed) ==
Number
.ParsingStatus.OK;
1263
return
Number
.ParseBinaryInteger<byte, uint>(utf8Text, style, NumberFormatInfo.GetInstance(provider));
1270
return
Number
.TryParseBinaryInteger(utf8Text, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt64.cs (23)
110
return
Number
.UInt64ToDecStr(m_value);
115
return
Number
.UInt64ToDecStr(m_value);
120
return
Number
.FormatUInt64(m_value, format, null);
125
return
Number
.FormatUInt64(m_value, format, provider);
130
return
Number
.TryFormatUInt64(m_value, format, provider, destination, out charsWritten);
136
return
Number
.TryFormatUInt64(m_value, format, provider, utf8Destination, out bytesWritten);
154
return
Number
.ParseBinaryInteger<char, ulong>(s, style, NumberFormatInfo.GetInstance(provider));
170
return
Number
.TryParseBinaryInteger(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
176
return
Number
.TryParseBinaryInteger(s, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
1182
return
Number
.TryParseBinaryInteger(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
1189
return
Number
.TryParseBinaryInteger(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
1196
return
Number
.TryParseBinaryInteger(utf8Text, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out bytesConsumed) ==
Number
.ParsingStatus.OK;
1264
return
Number
.ParseBinaryInteger<byte, ulong>(utf8Text, style, NumberFormatInfo.GetInstance(provider));
1271
return
Number
.TryParseBinaryInteger(utf8Text, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
src\runtime\src\libraries\System.Private.CoreLib\src\System\UIntPtr.cs (9)
1182
return
Number
.TryParseBinaryInteger(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out Unsafe.As<nuint, nuint_t>(ref result), out charsConsumed) ==
Number
.ParsingStatus.OK;
1190
return
Number
.TryParseBinaryInteger(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out Unsafe.As<nuint, nuint_t>(ref result), out charsConsumed) ==
Number
.ParsingStatus.OK;
1198
return
Number
.TryParseBinaryInteger(utf8Text, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out Unsafe.As<nuint, nuint_t>(ref result), out bytesConsumed) ==
Number
.ParsingStatus.OK;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Version.cs (7)
174
Span<char> dest = stackalloc char[(4 *
Number
.Int32NumberBufferLength) + 3]; // at most 4 Int32s and 3 periods
433
Number
.ParsingStatus parseStatus =
Number
.TryParseBinaryIntegerStyle(component, NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out parsedComponent, out _);
435
if (parseStatus ==
Number
.ParsingStatus.OK && parsedComponent >= 0)
448
static void ThrowFailure(
Number
.ParsingStatus parseStatus, int parsedComponent, string componentName, ReadOnlySpan<TChar> originalInput)
452
if (parseStatus ==
Number
.ParsingStatus.Overflow)
454
Number
.ThrowOverflowException<int>();