1030 references to Number
System.Private.CoreLib (1030)
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 (15)
163
Number
.ThrowDecimalOverflowException();
619
Number
.ThrowDecimalOverflowException();
699
Number
.ThrowDecimalOverflowException();
724
Number
.ThrowDecimalOverflowException();
779
Number
.ThrowDecimalOverflowException();
905
Number
.ThrowDecimalOverflowException();
1169
Number
.ThrowDecimalOverflowException();
1585
Number
.ThrowDecimalOverflowException();
1625
Number
.ThrowDecimalOverflowException();
1694
/// <see cref="
Number
.ComputeFloat{TFloat}(long, ulong)"/>), which avoid the integer division that
1713
return TFloat.CreateSaturating((double)low64 /
Number
.Pow10DoubleTable[scale]);
1719
(int Exponent, ulong Mantissa) am =
Number
.ComputeFloat<TFloat>(-scale, low64);
1948
Number
.ThrowDecimalOverflowException();
2026
Number
.ThrowDecimalOverflowException();
2097
Number
.ThrowDecimalOverflowException();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Double.cs (18)
359
return
Number
.FormatFloat(m_value, null, NumberFormatInfo.CurrentInfo);
364
return
Number
.FormatFloat(m_value, format, NumberFormatInfo.CurrentInfo);
369
return
Number
.FormatFloat(m_value, null, NumberFormatInfo.GetInstance(provider));
374
return
Number
.FormatFloat(m_value, format, NumberFormatInfo.GetInstance(provider));
379
return
Number
.TryFormatFloat(m_value, format, NumberFormatInfo.GetInstance(provider), destination, out charsWritten);
385
return
Number
.TryFormatFloat(m_value, format, NumberFormatInfo.GetInstance(provider), utf8Destination, out bytesWritten);
414
return
Number
.ParseFloat<char, double>(s, style, NumberFormatInfo.GetInstance(provider));
430
return
Number
.TryParseFloat(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _);
436
return
Number
.TryParseFloat(s, style, NumberFormatInfo.GetInstance(provider), out result, out _);
1500
return
Number
.TryParseFloat(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed);
1507
return
Number
.TryParseFloat(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed);
1514
return
Number
.TryParseFloat(utf8Text, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out bytesConsumed);
2315
return
Number
.ParseFloat<byte, double>(utf8Text, style, NumberFormatInfo.GetInstance(provider));
2322
return
Number
.TryParseFloat(utf8Text, style, NumberFormatInfo.GetInstance(provider), out result, out _);
2335
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)
359
return
Number
.ParseFloat<char, Half>(s, style, NumberFormatInfo.GetInstance(provider));
395
return
Number
.TryParseFloat(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _);
409
return
Number
.TryParseFloat(s, style, NumberFormatInfo.GetInstance(provider), out result, out _);
503
return
Number
.FormatFloat(this, null, NumberFormatInfo.CurrentInfo);
511
return
Number
.FormatFloat(this, format, NumberFormatInfo.CurrentInfo);
519
return
Number
.FormatFloat(this, null, NumberFormatInfo.GetInstance(provider));
527
return
Number
.FormatFloat(this, format, NumberFormatInfo.GetInstance(provider));
540
return
Number
.TryFormatFloat(this, format, NumberFormatInfo.GetInstance(provider), destination, out charsWritten);
546
return
Number
.TryFormatFloat(this, format, NumberFormatInfo.GetInstance(provider), utf8Destination, out bytesWritten);
2171
return
Number
.TryParseFloat(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed);
2178
return
Number
.TryParseFloat(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed);
2185
return
Number
.TryParseFloat(utf8Text, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out bytesConsumed);
2336
return
Number
.ParseFloat<byte, Half>(utf8Text, style, NumberFormatInfo.GetInstance(provider));
2343
return
Number
.TryParseFloat(utf8Text, style, NumberFormatInfo.GetInstance(provider), out result, out _);
2356
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)
1372
return
Number
.TryParseBinaryInteger(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out Unsafe.As<nint, nint_t>(ref result), out charsConsumed) ==
Number
.ParsingStatus.OK;
1380
return
Number
.TryParseBinaryInteger(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out Unsafe.As<nint, nint_t>(ref result), out charsConsumed) ==
Number
.ParsingStatus.OK;
1388
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)
489
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);
2113
return
Number
.ParseFloat<byte, BFloat16>(utf8Text, style, NumberFormatInfo.GetInstance(provider));
2120
return
Number
.TryParseFloat(utf8Text, style, NumberFormatInfo.GetInstance(provider), out result, out _);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal128.cs (174)
133
return
Number
.ParseDecimalIeee754<char, Decimal128, UInt128>(s, style, NumberFormatInfo.GetInstance(provider));
191
return
Number
.TryParseDecimalIeee754<char, Decimal128, UInt128>(s, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
205
return
Number
.TryParseDecimalIeee754<char, Decimal128, UInt128>(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
223
return
Number
.CompareDecimalIeee754<Decimal128, UInt128>(current, another);
231
return
Number
.CompareDecimalIeee754<Decimal128, UInt128>(current, another) == 0;
247
return
Number
.GetDecimalIeee754HashCode<Decimal128, UInt128>(new UInt128(_upper, _lower));
266
public static UInt128 EncodeDecimal(Decimal128 x) =>
Number
.EncodeDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower));
272
public static Decimal128 DecodeDecimal(UInt128 x) => new Decimal128(
Number
.DecodeDecimalIeee754<Decimal128, UInt128>(x));
279
return
Number
.FormatDecimalIeee754<Decimal128, UInt128>(new UInt128(_upper, _lower), null, NumberFormatInfo.CurrentInfo);
287
return
Number
.FormatDecimalIeee754<Decimal128, UInt128>(new UInt128(_upper, _lower), format, NumberFormatInfo.CurrentInfo);
295
return
Number
.FormatDecimalIeee754<Decimal128, UInt128>(new UInt128(_upper, _lower), null, NumberFormatInfo.GetInstance(provider));
303
return
Number
.FormatDecimalIeee754<Decimal128, UInt128>(new UInt128(_upper, _lower), format, NumberFormatInfo.GetInstance(provider));
309
return
Number
.TryFormatDecimalIeee754<Decimal128, UInt128, char>(new UInt128(_upper, _lower), format, NumberFormatInfo.GetInstance(provider), destination, out charsWritten);
315
return
Number
.TryFormatDecimalIeee754<Decimal128, UInt128, byte>(new UInt128(_upper, _lower), format, NumberFormatInfo.GetInstance(provider), utf8Destination, out bytesWritten);
333
UInt128 result =
Number
.AddDecimalIeee754<Decimal128, UInt128>(new UInt128(value._upper, value._lower), OneValue);
342
UInt128 result =
Number
.SubtractDecimalIeee754<Decimal128, UInt128>(new UInt128(value._upper, value._lower), OneValue);
352
UInt128 result =
Number
.AddDecimalIeee754<Decimal128, UInt128>(new UInt128(left._upper, left._lower), new UInt128(right._upper, right._lower));
362
UInt128 result =
Number
.SubtractDecimalIeee754<Decimal128, UInt128>(new UInt128(left._upper, left._lower), new UInt128(right._upper, right._lower));
372
UInt128 result =
Number
.MultiplyDecimalIeee754<Decimal128, UInt128>(new UInt128(left._upper, left._lower), new UInt128(right._upper, right._lower));
382
UInt128 result =
Number
.DivideDecimalIeee754<Decimal128, UInt128>(new UInt128(left._upper, left._lower), new UInt128(right._upper, right._lower));
392
UInt128 result =
Number
.RemainderDecimalIeee754<Decimal128, UInt128>(new UInt128(left._upper, left._lower), new UInt128(right._upper, right._lower));
403
public static explicit operator Decimal128(Int128 value) => new Decimal128(
Number
.ConvertIntegerToDecimalIeee754<Decimal128, UInt128, Int128>(value));
409
public static explicit operator Decimal128(UInt128 value) => new Decimal128(
Number
.ConvertIntegerToDecimalIeee754<Decimal128, UInt128, UInt128>(value));
414
public static explicit operator Decimal128(Half value) => new Decimal128(
Number
.ConvertFloatToDecimalIeee754<Half, Decimal128, UInt128>(value));
419
public static explicit operator Decimal128(float value) => new Decimal128(
Number
.ConvertFloatToDecimalIeee754<float, Decimal128, UInt128>(value));
424
public static explicit operator Decimal128(double value) => new Decimal128(
Number
.ConvertFloatToDecimalIeee754<double, Decimal128, UInt128>(value));
433
public static explicit operator byte(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, byte>(new UInt128(value._upper, value._lower), isChecked: false);
439
public static explicit operator checked byte(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, byte>(new UInt128(value._upper, value._lower), isChecked: true);
445
public static explicit operator sbyte(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, sbyte>(new UInt128(value._upper, value._lower), isChecked: false);
452
public static explicit operator checked sbyte(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, sbyte>(new UInt128(value._upper, value._lower), isChecked: true);
457
public static explicit operator char(Decimal128 value) => (char)
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, ushort>(new UInt128(value._upper, value._lower), isChecked: false);
463
public static explicit operator checked char(Decimal128 value) => (char)
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, ushort>(new UInt128(value._upper, value._lower), isChecked: true);
468
public static explicit operator short(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, short>(new UInt128(value._upper, value._lower), isChecked: false);
474
public static explicit operator checked short(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, short>(new UInt128(value._upper, value._lower), isChecked: true);
480
public static explicit operator ushort(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, ushort>(new UInt128(value._upper, value._lower), isChecked: false);
487
public static explicit operator checked ushort(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, ushort>(new UInt128(value._upper, value._lower), isChecked: true);
492
public static explicit operator int(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, int>(new UInt128(value._upper, value._lower), isChecked: false);
498
public static explicit operator checked int(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, int>(new UInt128(value._upper, value._lower), isChecked: true);
504
public static explicit operator uint(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, uint>(new UInt128(value._upper, value._lower), isChecked: false);
511
public static explicit operator checked uint(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, uint>(new UInt128(value._upper, value._lower), isChecked: true);
516
public static explicit operator nint(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, nint>(new UInt128(value._upper, value._lower), isChecked: false);
522
public static explicit operator checked nint(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, nint>(new UInt128(value._upper, value._lower), isChecked: true);
528
public static explicit operator nuint(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, nuint>(new UInt128(value._upper, value._lower), isChecked: false);
535
public static explicit operator checked nuint(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, nuint>(new UInt128(value._upper, value._lower), isChecked: true);
540
public static explicit operator long(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, long>(new UInt128(value._upper, value._lower), isChecked: false);
546
public static explicit operator checked long(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, long>(new UInt128(value._upper, value._lower), isChecked: true);
552
public static explicit operator ulong(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, ulong>(new UInt128(value._upper, value._lower), isChecked: false);
559
public static explicit operator checked ulong(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, ulong>(new UInt128(value._upper, value._lower), isChecked: true);
564
public static explicit operator Int128(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, Int128>(new UInt128(value._upper, value._lower), isChecked: false);
570
public static explicit operator checked Int128(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, Int128>(new UInt128(value._upper, value._lower), isChecked: true);
576
public static explicit operator UInt128(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, UInt128>(new UInt128(value._upper, value._lower), isChecked: false);
583
public static explicit operator checked UInt128(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal128, UInt128, UInt128>(new UInt128(value._upper, value._lower), isChecked: true);
588
public static explicit operator Half(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToFloat<Decimal128, UInt128, Half>(new UInt128(value._upper, value._lower));
593
public static explicit operator float(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToFloat<Decimal128, UInt128, float>(new UInt128(value._upper, value._lower));
598
public static explicit operator double(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToFloat<Decimal128, UInt128, double>(new UInt128(value._upper, value._lower));
604
public static explicit operator decimal(Decimal128 value) =>
Number
.ConvertDecimalIeee754ToDecimal<Decimal128, UInt128>(new UInt128(value._upper, value._lower));
613
public static implicit operator Decimal128(byte value) => new Decimal128(
Number
.ConvertIntegerToDecimalIeee754<Decimal128, UInt128, byte>(value));
619
public static implicit operator Decimal128(sbyte value) => new Decimal128(
Number
.ConvertIntegerToDecimalIeee754<Decimal128, UInt128, sbyte>(value));
624
public static implicit operator Decimal128(char value) => new Decimal128(
Number
.ConvertIntegerToDecimalIeee754<Decimal128, UInt128, ushort>(value));
629
public static implicit operator Decimal128(short value) => new Decimal128(
Number
.ConvertIntegerToDecimalIeee754<Decimal128, UInt128, short>(value));
635
public static implicit operator Decimal128(ushort value) => new Decimal128(
Number
.ConvertIntegerToDecimalIeee754<Decimal128, UInt128, ushort>(value));
640
public static implicit operator Decimal128(int value) => new Decimal128(
Number
.ConvertIntegerToDecimalIeee754<Decimal128, UInt128, int>(value));
646
public static implicit operator Decimal128(uint value) => new Decimal128(
Number
.ConvertIntegerToDecimalIeee754<Decimal128, UInt128, uint>(value));
651
public static implicit operator Decimal128(nint value) => new Decimal128(
Number
.ConvertIntegerToDecimalIeee754<Decimal128, UInt128, nint>(value));
657
public static implicit operator Decimal128(nuint value) => new Decimal128(
Number
.ConvertIntegerToDecimalIeee754<Decimal128, UInt128, nuint>(value));
662
public static implicit operator Decimal128(long value) => new Decimal128(
Number
.ConvertIntegerToDecimalIeee754<Decimal128, UInt128, long>(value));
668
public static implicit operator Decimal128(ulong value) => new Decimal128(
Number
.ConvertIntegerToDecimalIeee754<Decimal128, UInt128, ulong>(value));
673
public static implicit operator Decimal128(decimal value) => new Decimal128(
Number
.ConvertDecimalToDecimalIeee754<Decimal128, UInt128>(value));
681
return
Number
.EqualsDecimalIeee754<Decimal128, UInt128>(new UInt128(left._upper, left._lower), new UInt128(right._upper, right._lower));
699
return
Number
.LessThanDecimalIeee754<Decimal128, UInt128>(new UInt128(left._upper, left._lower), new UInt128(right._upper, right._lower));
708
return
Number
.GreaterThanDecimalIeee754<Decimal128, UInt128>(new UInt128(left._upper, left._lower), new UInt128(right._upper, right._lower));
717
return
Number
.LessThanOrEqualDecimalIeee754<Decimal128, UInt128>(new UInt128(left._upper, left._lower), new UInt128(right._upper, right._lower));
726
return
Number
.GreaterThanOrEqualDecimalIeee754<Decimal128, UInt128>(new UInt128(left._upper, left._lower), new UInt128(right._upper, right._lower));
737
return
Number
.TryParseDecimalIeee754<char, Decimal128, UInt128>(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
744
return
Number
.TryParseDecimalIeee754<char, Decimal128, UInt128>(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
751
return
Number
.TryParseDecimalIeee754<byte, Decimal128, UInt128>(utf8Text, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out bytesConsumed) ==
Number
.ParsingStatus.OK;
766
return
Number
.ParseDecimalIeee754<byte, Decimal128, UInt128>(utf8Text, style, NumberFormatInfo.GetInstance(provider));
773
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;
795
public static Decimal128 Ceiling(Decimal128 x) => new Decimal128(
Number
.RoundDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), 0, MidpointRounding.ToPositiveInfinity));
806
public static Decimal128 Floor(Decimal128 x) => new Decimal128(
Number
.RoundDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), 0, MidpointRounding.ToNegativeInfinity));
809
public static Decimal128 Round(Decimal128 x) => new Decimal128(
Number
.RoundDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), 0, MidpointRounding.ToEven));
812
public static Decimal128 Round(Decimal128 x, int digits) => new Decimal128(
Number
.RoundDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), digits, MidpointRounding.ToEven));
815
public static Decimal128 Round(Decimal128 x, MidpointRounding mode) => new Decimal128(
Number
.RoundDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), 0, mode));
818
public static Decimal128 Round(Decimal128 x, int digits, MidpointRounding mode) => new Decimal128(
Number
.RoundDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), digits, mode));
821
public static Decimal128 Truncate(Decimal128 x) => new Decimal128(
Number
.RoundDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), 0, MidpointRounding.ToZero));
829
int exponent =
Number
.UnpackDecimalIeee754<Decimal128, UInt128>(new UInt128(_upper, _lower)).UnbiasedExponent;
850
if (BinaryPrimitives.TryWriteInt32BigEndian(destination,
Number
.UnpackDecimalIeee754<Decimal128, UInt128>(new UInt128(_upper, _lower)).UnbiasedExponent))
863
if (BinaryPrimitives.TryWriteInt32LittleEndian(destination,
Number
.UnpackDecimalIeee754<Decimal128, UInt128>(new UInt128(_upper, _lower)).UnbiasedExponent))
876
if (BinaryPrimitives.TryWriteUInt128BigEndian(destination,
Number
.UnpackDecimalIeee754<Decimal128, UInt128>(new UInt128(_upper, _lower)).Significand))
889
if (BinaryPrimitives.TryWriteUInt128LittleEndian(destination,
Number
.UnpackDecimalIeee754<Decimal128, UInt128>(new UInt128(_upper, _lower)).Significand))
904
public static Decimal128 Acos(Decimal128 x) => new Decimal128(
Number
.AcosDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
907
public static Decimal128 AcosPi(Decimal128 x) => new Decimal128(
Number
.AcosPiDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
910
public static Decimal128 Acosh(Decimal128 x) => new Decimal128(
Number
.AcoshDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
913
public static Decimal128 Asin(Decimal128 x) => new Decimal128(
Number
.AsinDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
916
public static Decimal128 AsinPi(Decimal128 x) => new Decimal128(
Number
.AsinPiDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
919
public static Decimal128 Asinh(Decimal128 x) => new Decimal128(
Number
.AsinhDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
922
public static Decimal128 Atan(Decimal128 x) => new Decimal128(
Number
.AtanDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
925
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)));
928
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)));
931
public static Decimal128 AtanPi(Decimal128 x) => new Decimal128(
Number
.AtanPiDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
934
public static Decimal128 Atanh(Decimal128 x) => new Decimal128(
Number
.AtanhDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
937
public static Decimal128 BitDecrement(Decimal128 x) => new Decimal128(
Number
.BitDecrementDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
940
public static Decimal128 BitIncrement(Decimal128 x) => new Decimal128(
Number
.BitIncrementDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
943
public static Decimal128 Cbrt(Decimal128 x) => new Decimal128(
Number
.CbrtDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
946
public static Decimal128 Cos(Decimal128 x) => new Decimal128(
Number
.CosDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
949
public static Decimal128 CosPi(Decimal128 x) => new Decimal128(
Number
.CosPiDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
952
public static Decimal128 Cosh(Decimal128 x) => new Decimal128(
Number
.CoshDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
955
public static Decimal128 Exp(Decimal128 x) => new Decimal128(
Number
.ExpDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
958
public static Decimal128 Exp10(Decimal128 x) => new Decimal128(
Number
.Exp10DecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
961
public static Decimal128 Exp10M1(Decimal128 x) => new Decimal128(
Number
.Exp10M1DecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
964
public static Decimal128 Exp2(Decimal128 x) => new Decimal128(
Number
.Exp2DecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
967
public static Decimal128 Exp2M1(Decimal128 x) => new Decimal128(
Number
.Exp2M1DecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
970
public static Decimal128 ExpM1(Decimal128 x) => new Decimal128(
Number
.ExpM1DecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
973
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)));
976
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)));
979
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)));
982
public static int ILogB(Decimal128 x) =>
Number
.ILogBDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower));
988
public static Decimal128 Log(Decimal128 x) => new Decimal128(
Number
.LogDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
991
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)));
994
public static Decimal128 Log10(Decimal128 x) => new Decimal128(
Number
.Log10DecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
997
public static Decimal128 Log10P1(Decimal128 x) => new Decimal128(
Number
.Log10P1DecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
1000
public static Decimal128 Log2(Decimal128 x) => new Decimal128(
Number
.Log2DecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
1003
public static Decimal128 Log2P1(Decimal128 x) => new Decimal128(
Number
.Log2P1DecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
1006
public static Decimal128 LogP1(Decimal128 x) => new Decimal128(
Number
.LogP1DecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
1009
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)));
1018
public static Decimal128 RootN(Decimal128 x, int n) => new Decimal128(
Number
.RootNDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), n));
1021
public static Decimal128 ScaleB(Decimal128 x, int n) => new Decimal128(
Number
.ScaleBDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), n));
1024
public static Decimal128 Sin(Decimal128 x) => new Decimal128(
Number
.SinDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
1029
(UInt128 sin, UInt128 cos) =
Number
.SinCosDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower));
1036
(UInt128 sin, UInt128 cos) =
Number
.SinCosPiDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower));
1041
public static Decimal128 SinPi(Decimal128 x) => new Decimal128(
Number
.SinPiDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
1044
public static Decimal128 Sinh(Decimal128 x) => new Decimal128(
Number
.SinhDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
1047
public static Decimal128 Sqrt(Decimal128 x) => new Decimal128(
Number
.SqrtDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
1050
public static Decimal128 Tan(Decimal128 x) => new Decimal128(
Number
.TanDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
1053
public static Decimal128 TanPi(Decimal128 x) => new Decimal128(
Number
.TanPiDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
1056
public static Decimal128 Tanh(Decimal128 x) => new Decimal128(
Number
.TanhDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
1062
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)));
1067
public static Decimal128 GetQuantum(Decimal128 x) => new Decimal128(
Number
.QuantumDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower)));
1073
public static bool HaveSameQuantum(Decimal128 x, Decimal128 y) =>
Number
.SameQuantumDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), new UInt128(y._upper, y._lower));
1078
public static Decimal128 Abs(Decimal128 value) => new Decimal128(
Number
.AbsDecimalIeee754<Decimal128, UInt128>(new UInt128(value._upper, value._lower)));
1123
public static bool IsInteger(Decimal128 value) =>
Number
.IsIntegerDecimalIeee754<Decimal128, UInt128>(new UInt128(value._upper, value._lower));
1128
public static bool IsEvenInteger(Decimal128 value) =>
Number
.IsEvenIntegerDecimalIeee754<Decimal128, UInt128>(new UInt128(value._upper, value._lower));
1133
public static bool IsOddInteger(Decimal128 value) =>
Number
.IsOddIntegerDecimalIeee754<Decimal128, UInt128>(new UInt128(value._upper, value._lower));
1138
public static bool IsNormal(Decimal128 value) =>
Number
.IsNormalDecimalIeee754<Decimal128, UInt128>(new UInt128(value._upper, value._lower));
1143
public static bool IsSubnormal(Decimal128 value) =>
Number
.IsSubnormalDecimalIeee754<Decimal128, UInt128>(new UInt128(value._upper, value._lower));
1149
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)));
1155
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)));
1161
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)));
1167
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)));
1210
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)));
1216
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)));
1222
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)));
1228
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)));
1234
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)));
1240
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)));
1246
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)));
1252
public static int Sign(Decimal128 value) =>
Number
.SignDecimalIeee754<Decimal128, UInt128>(new UInt128(value._upper, value._lower));
1258
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));
1267
static bool INumberBase<Decimal128>.IsZero(Decimal128 value) =>
Number
.IsZeroDecimalIeee754<Decimal128, UInt128>(new UInt128(value._upper, value._lower));
1741
return
Number
.UInt128ToDecStr(significand);
1744
static unsafe UInt128 IDecimalIeee754ParseAndFormatInfo<Decimal128, UInt128>.NumberToSignificand(ref
Number
.NumberBuffer number, int digits)
1748
return
Number
.DigitsToUInt64(number.DigitsPtr, digits);
1752
Number
.AccumulateDecimalDigitsIntoBigInteger(ref number, 0, (uint)digits, out
Number
.BigInteger result);
1773
static int IDecimalIeee754ParseAndFormatInfo<Decimal128, UInt128>.BufferLength =>
Number
.Decimal128NumberBufferLength;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal32.cs (177)
137
return
Number
.ParseDecimalIeee754<char, Decimal32, uint>(s, style, NumberFormatInfo.GetInstance(provider));
195
return
Number
.TryParseDecimalIeee754<char, Decimal32, uint>(s, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
209
return
Number
.TryParseDecimalIeee754<char, Decimal32, uint>(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
225
return
Number
.CompareDecimalIeee754<Decimal32, uint>(_value, i._value);
231
return
Number
.CompareDecimalIeee754<Decimal32, uint>(_value, other._value);
237
return
Number
.CompareDecimalIeee754<Decimal32, uint>(_value, other._value) == 0;
253
return
Number
.GetDecimalIeee754HashCode<Decimal32, uint>(_value);
272
public static uint EncodeDecimal(Decimal32 x) =>
Number
.EncodeDecimalIeee754<Decimal32, uint>(x._value);
278
public static Decimal32 DecodeDecimal(uint x) => new Decimal32(
Number
.DecodeDecimalIeee754<Decimal32, uint>(x));
285
return
Number
.FormatDecimalIeee754<Decimal32, uint>(_value, null, NumberFormatInfo.CurrentInfo);
293
return
Number
.FormatDecimalIeee754<Decimal32, uint>(_value, format, NumberFormatInfo.CurrentInfo);
301
return
Number
.FormatDecimalIeee754<Decimal32, uint>(_value, null, NumberFormatInfo.GetInstance(provider));
309
return
Number
.FormatDecimalIeee754<Decimal32, uint>(_value, format, NumberFormatInfo.GetInstance(provider));
315
return
Number
.TryFormatDecimalIeee754<Decimal32, uint, char>(_value, format, NumberFormatInfo.GetInstance(provider), destination, out charsWritten);
321
return
Number
.TryFormatDecimalIeee754<Decimal32, uint, byte>(_value, format, NumberFormatInfo.GetInstance(provider), utf8Destination, out bytesWritten);
339
return new Decimal32(
Number
.AddDecimalIeee754<Decimal32, uint>(value._value, OneValue));
347
return new Decimal32(
Number
.SubtractDecimalIeee754<Decimal32, uint>(value._value, OneValue));
356
return new Decimal32(
Number
.AddDecimalIeee754<Decimal32, uint>(left._value, right._value));
365
return new Decimal32(
Number
.SubtractDecimalIeee754<Decimal32, uint>(left._value, right._value));
374
return new Decimal32(
Number
.MultiplyDecimalIeee754<Decimal32, uint>(left._value, right._value));
383
return new Decimal32(
Number
.DivideDecimalIeee754<Decimal32, uint>(left._value, right._value));
392
return new Decimal32(
Number
.RemainderDecimalIeee754<Decimal32, uint>(left._value, right._value));
402
public static explicit operator Decimal32(int value) => new Decimal32(
Number
.ConvertIntegerToDecimalIeee754<Decimal32, uint, int>(value));
408
public static explicit operator Decimal32(uint value) => new Decimal32(
Number
.ConvertIntegerToDecimalIeee754<Decimal32, uint, uint>(value));
413
public static explicit operator Decimal32(nint value) => new Decimal32(
Number
.ConvertIntegerToDecimalIeee754<Decimal32, uint, nint>(value));
419
public static explicit operator Decimal32(nuint value) => new Decimal32(
Number
.ConvertIntegerToDecimalIeee754<Decimal32, uint, nuint>(value));
424
public static explicit operator Decimal32(long value) => new Decimal32(
Number
.ConvertIntegerToDecimalIeee754<Decimal32, uint, long>(value));
430
public static explicit operator Decimal32(ulong value) => new Decimal32(
Number
.ConvertIntegerToDecimalIeee754<Decimal32, uint, ulong>(value));
435
public static explicit operator Decimal32(Int128 value) => new Decimal32(
Number
.ConvertIntegerToDecimalIeee754<Decimal32, uint, Int128>(value));
441
public static explicit operator Decimal32(UInt128 value) => new Decimal32(
Number
.ConvertIntegerToDecimalIeee754<Decimal32, uint, UInt128>(value));
446
public static explicit operator Decimal32(Half value) => new Decimal32(
Number
.ConvertFloatToDecimalIeee754<Half, Decimal32, uint>(value));
451
public static explicit operator Decimal32(float value) => new Decimal32(
Number
.ConvertFloatToDecimalIeee754<float, Decimal32, uint>(value));
456
public static explicit operator Decimal32(double value) => new Decimal32(
Number
.ConvertFloatToDecimalIeee754<double, Decimal32, uint>(value));
461
public static explicit operator Decimal32(Decimal64 value) => new Decimal32(
Number
.ConvertDecimalIeee754<Decimal64, ulong, Decimal32, uint>(value._value));
466
public static explicit operator Decimal32(Decimal128 value) => new Decimal32(
Number
.ConvertDecimalIeee754<Decimal128, UInt128, Decimal32, uint>(new UInt128(value._upper, value._lower)));
471
public static explicit operator Decimal32(decimal value) => new Decimal32(
Number
.ConvertDecimalToDecimalIeee754<Decimal32, uint>(value));
480
public static explicit operator byte(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, byte>(value._value, isChecked: false);
486
public static explicit operator checked byte(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, byte>(value._value, isChecked: true);
492
public static explicit operator sbyte(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, sbyte>(value._value, isChecked: false);
499
public static explicit operator checked sbyte(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, sbyte>(value._value, isChecked: true);
504
public static explicit operator char(Decimal32 value) => (char)
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, ushort>(value._value, isChecked: false);
510
public static explicit operator checked char(Decimal32 value) => (char)
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, ushort>(value._value, isChecked: true);
515
public static explicit operator short(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, short>(value._value, isChecked: false);
521
public static explicit operator checked short(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, short>(value._value, isChecked: true);
527
public static explicit operator ushort(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, ushort>(value._value, isChecked: false);
534
public static explicit operator checked ushort(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, ushort>(value._value, isChecked: true);
539
public static explicit operator int(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, int>(value._value, isChecked: false);
545
public static explicit operator checked int(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, int>(value._value, isChecked: true);
551
public static explicit operator uint(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, uint>(value._value, isChecked: false);
558
public static explicit operator checked uint(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, uint>(value._value, isChecked: true);
563
public static explicit operator nint(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, nint>(value._value, isChecked: false);
569
public static explicit operator checked nint(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, nint>(value._value, isChecked: true);
575
public static explicit operator nuint(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, nuint>(value._value, isChecked: false);
582
public static explicit operator checked nuint(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, nuint>(value._value, isChecked: true);
587
public static explicit operator long(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, long>(value._value, isChecked: false);
593
public static explicit operator checked long(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, long>(value._value, isChecked: true);
599
public static explicit operator ulong(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, ulong>(value._value, isChecked: false);
606
public static explicit operator checked ulong(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, ulong>(value._value, isChecked: true);
611
public static explicit operator Int128(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, Int128>(value._value, isChecked: false);
617
public static explicit operator checked Int128(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, Int128>(value._value, isChecked: true);
623
public static explicit operator UInt128(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, UInt128>(value._value, isChecked: false);
630
public static explicit operator checked UInt128(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal32, uint, UInt128>(value._value, isChecked: true);
635
public static explicit operator Half(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToFloat<Decimal32, uint, Half>(value._value);
640
public static explicit operator float(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToFloat<Decimal32, uint, float>(value._value);
645
public static explicit operator double(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToFloat<Decimal32, uint, double>(value._value);
651
public static explicit operator decimal(Decimal32 value) =>
Number
.ConvertDecimalIeee754ToDecimal<Decimal32, uint>(value._value);
660
public static implicit operator Decimal32(byte value) => new Decimal32(
Number
.ConvertIntegerToDecimalIeee754<Decimal32, uint, byte>(value));
666
public static implicit operator Decimal32(sbyte value) => new Decimal32(
Number
.ConvertIntegerToDecimalIeee754<Decimal32, uint, sbyte>(value));
671
public static implicit operator Decimal32(char value) => new Decimal32(
Number
.ConvertIntegerToDecimalIeee754<Decimal32, uint, ushort>(value));
676
public static implicit operator Decimal32(short value) => new Decimal32(
Number
.ConvertIntegerToDecimalIeee754<Decimal32, uint, short>(value));
682
public static implicit operator Decimal32(ushort value) => new Decimal32(
Number
.ConvertIntegerToDecimalIeee754<Decimal32, uint, ushort>(value));
691
public static implicit operator Decimal64(Decimal32 value) => new Decimal64(
Number
.ConvertDecimalIeee754<Decimal32, uint, Decimal64, ulong>(value._value));
696
public static implicit operator Decimal128(Decimal32 value) => new Decimal128(
Number
.ConvertDecimalIeee754<Decimal32, uint, Decimal128, UInt128>(value._value));
704
return
Number
.EqualsDecimalIeee754<Decimal32, uint>(left._value, right._value);
722
return
Number
.LessThanDecimalIeee754<Decimal32, uint>(left._value, right._value);
731
return
Number
.GreaterThanDecimalIeee754<Decimal32, uint>(left._value, right._value);
740
return
Number
.LessThanOrEqualDecimalIeee754<Decimal32, uint>(left._value, right._value);
749
return
Number
.GreaterThanOrEqualDecimalIeee754<Decimal32, uint>(left._value, right._value);
760
return
Number
.TryParseDecimalIeee754<char, Decimal32, uint>(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
767
return
Number
.TryParseDecimalIeee754<char, Decimal32, uint>(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
774
return
Number
.TryParseDecimalIeee754<byte, Decimal32, uint>(utf8Text, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out bytesConsumed) ==
Number
.ParsingStatus.OK;
789
return
Number
.ParseDecimalIeee754<byte, Decimal32, uint>(utf8Text, style, NumberFormatInfo.GetInstance(provider));
796
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;
818
public static Decimal32 Ceiling(Decimal32 x) => new Decimal32(
Number
.RoundDecimalIeee754<Decimal32, uint>(x._value, 0, MidpointRounding.ToPositiveInfinity));
829
public static Decimal32 Floor(Decimal32 x) => new Decimal32(
Number
.RoundDecimalIeee754<Decimal32, uint>(x._value, 0, MidpointRounding.ToNegativeInfinity));
832
public static Decimal32 Round(Decimal32 x) => new Decimal32(
Number
.RoundDecimalIeee754<Decimal32, uint>(x._value, 0, MidpointRounding.ToEven));
835
public static Decimal32 Round(Decimal32 x, int digits) => new Decimal32(
Number
.RoundDecimalIeee754<Decimal32, uint>(x._value, digits, MidpointRounding.ToEven));
838
public static Decimal32 Round(Decimal32 x, MidpointRounding mode) => new Decimal32(
Number
.RoundDecimalIeee754<Decimal32, uint>(x._value, 0, mode));
841
public static Decimal32 Round(Decimal32 x, int digits, MidpointRounding mode) => new Decimal32(
Number
.RoundDecimalIeee754<Decimal32, uint>(x._value, digits, mode));
844
public static Decimal32 Truncate(Decimal32 x) => new Decimal32(
Number
.RoundDecimalIeee754<Decimal32, uint>(x._value, 0, MidpointRounding.ToZero));
852
int exponent =
Number
.UnpackDecimalIeee754<Decimal32, uint>(_value).UnbiasedExponent;
873
if (BinaryPrimitives.TryWriteInt32BigEndian(destination,
Number
.UnpackDecimalIeee754<Decimal32, uint>(_value).UnbiasedExponent))
886
if (BinaryPrimitives.TryWriteInt32LittleEndian(destination,
Number
.UnpackDecimalIeee754<Decimal32, uint>(_value).UnbiasedExponent))
899
if (BinaryPrimitives.TryWriteUInt32BigEndian(destination,
Number
.UnpackDecimalIeee754<Decimal32, uint>(_value).Significand))
912
if (BinaryPrimitives.TryWriteUInt32LittleEndian(destination,
Number
.UnpackDecimalIeee754<Decimal32, uint>(_value).Significand))
927
public static Decimal32 Acos(Decimal32 x) => new Decimal32(
Number
.AcosDecimalIeee754<Decimal32, uint>(x._value));
930
public static Decimal32 AcosPi(Decimal32 x) => new Decimal32(
Number
.AcosPiDecimalIeee754<Decimal32, uint>(x._value));
933
public static Decimal32 Acosh(Decimal32 x) => new Decimal32(
Number
.AcoshDecimalIeee754<Decimal32, uint>(x._value));
936
public static Decimal32 Asin(Decimal32 x) => new Decimal32(
Number
.AsinDecimalIeee754<Decimal32, uint>(x._value));
939
public static Decimal32 AsinPi(Decimal32 x) => new Decimal32(
Number
.AsinPiDecimalIeee754<Decimal32, uint>(x._value));
942
public static Decimal32 Asinh(Decimal32 x) => new Decimal32(
Number
.AsinhDecimalIeee754<Decimal32, uint>(x._value));
945
public static Decimal32 Atan(Decimal32 x) => new Decimal32(
Number
.AtanDecimalIeee754<Decimal32, uint>(x._value));
948
public static Decimal32 Atan2(Decimal32 y, Decimal32 x) => new Decimal32(
Number
.Atan2DecimalIeee754<Decimal32, uint>(y._value, x._value));
951
public static Decimal32 Atan2Pi(Decimal32 y, Decimal32 x) => new Decimal32(
Number
.Atan2PiDecimalIeee754<Decimal32, uint>(y._value, x._value));
954
public static Decimal32 AtanPi(Decimal32 x) => new Decimal32(
Number
.AtanPiDecimalIeee754<Decimal32, uint>(x._value));
957
public static Decimal32 Atanh(Decimal32 x) => new Decimal32(
Number
.AtanhDecimalIeee754<Decimal32, uint>(x._value));
960
public static Decimal32 BitDecrement(Decimal32 x) => new Decimal32(
Number
.BitDecrementDecimalIeee754<Decimal32, uint>(x._value));
963
public static Decimal32 BitIncrement(Decimal32 x) => new Decimal32(
Number
.BitIncrementDecimalIeee754<Decimal32, uint>(x._value));
966
public static Decimal32 Cbrt(Decimal32 x) => new Decimal32(
Number
.CbrtDecimalIeee754<Decimal32, uint>(x._value));
969
public static Decimal32 Cos(Decimal32 x) => new Decimal32(
Number
.CosDecimalIeee754<Decimal32, uint>(x._value));
972
public static Decimal32 CosPi(Decimal32 x) => new Decimal32(
Number
.CosPiDecimalIeee754<Decimal32, uint>(x._value));
975
public static Decimal32 Cosh(Decimal32 x) => new Decimal32(
Number
.CoshDecimalIeee754<Decimal32, uint>(x._value));
978
public static Decimal32 Exp(Decimal32 x) => new Decimal32(
Number
.ExpDecimalIeee754<Decimal32, uint>(x._value));
981
public static Decimal32 Exp10(Decimal32 x) => new Decimal32(
Number
.Exp10DecimalIeee754<Decimal32, uint>(x._value));
984
public static Decimal32 Exp10M1(Decimal32 x) => new Decimal32(
Number
.Exp10M1DecimalIeee754<Decimal32, uint>(x._value));
987
public static Decimal32 Exp2(Decimal32 x) => new Decimal32(
Number
.Exp2DecimalIeee754<Decimal32, uint>(x._value));
990
public static Decimal32 Exp2M1(Decimal32 x) => new Decimal32(
Number
.Exp2M1DecimalIeee754<Decimal32, uint>(x._value));
993
public static Decimal32 ExpM1(Decimal32 x) => new Decimal32(
Number
.ExpM1DecimalIeee754<Decimal32, uint>(x._value));
996
public static Decimal32 FusedMultiplyAdd(Decimal32 left, Decimal32 right, Decimal32 addend) => new Decimal32(
Number
.FusedMultiplyAddDecimalIeee754<Decimal32, uint>(left._value, right._value, addend._value));
999
public static Decimal32 Hypot(Decimal32 x, Decimal32 y) => new Decimal32(
Number
.HypotDecimalIeee754<Decimal32, uint>(x._value, y._value));
1002
public static Decimal32 Ieee754Remainder(Decimal32 left, Decimal32 right) => new Decimal32(
Number
.Ieee754RemainderDecimalIeee754<Decimal32, uint>(left._value, right._value));
1005
public static int ILogB(Decimal32 x) =>
Number
.ILogBDecimalIeee754<Decimal32, uint>(x._value);
1011
public static Decimal32 Log(Decimal32 x) => new Decimal32(
Number
.LogDecimalIeee754<Decimal32, uint>(x._value));
1014
public static Decimal32 Log(Decimal32 x, Decimal32 newBase) => new Decimal32(
Number
.LogDecimalIeee754<Decimal32, uint>(x._value, newBase._value));
1017
public static Decimal32 Log10(Decimal32 x) => new Decimal32(
Number
.Log10DecimalIeee754<Decimal32, uint>(x._value));
1020
public static Decimal32 Log10P1(Decimal32 x) => new Decimal32(
Number
.Log10P1DecimalIeee754<Decimal32, uint>(x._value));
1023
public static Decimal32 Log2(Decimal32 x) => new Decimal32(
Number
.Log2DecimalIeee754<Decimal32, uint>(x._value));
1026
public static Decimal32 Log2P1(Decimal32 x) => new Decimal32(
Number
.Log2P1DecimalIeee754<Decimal32, uint>(x._value));
1029
public static Decimal32 LogP1(Decimal32 x) => new Decimal32(
Number
.LogP1DecimalIeee754<Decimal32, uint>(x._value));
1032
public static Decimal32 Pow(Decimal32 x, Decimal32 y) => new Decimal32(
Number
.PowDecimalIeee754<Decimal32, uint>(x._value, y._value));
1041
public static Decimal32 RootN(Decimal32 x, int n) => new Decimal32(
Number
.RootNDecimalIeee754<Decimal32, uint>(x._value, n));
1044
public static Decimal32 ScaleB(Decimal32 x, int n) => new Decimal32(
Number
.ScaleBDecimalIeee754<Decimal32, uint>(x._value, n));
1047
public static Decimal32 Sin(Decimal32 x) => new Decimal32(
Number
.SinDecimalIeee754<Decimal32, uint>(x._value));
1052
(uint sin, uint cos) =
Number
.SinCosDecimalIeee754<Decimal32, uint>(x._value);
1059
(uint sin, uint cos) =
Number
.SinCosPiDecimalIeee754<Decimal32, uint>(x._value);
1064
public static Decimal32 SinPi(Decimal32 x) => new Decimal32(
Number
.SinPiDecimalIeee754<Decimal32, uint>(x._value));
1067
public static Decimal32 Sinh(Decimal32 x) => new Decimal32(
Number
.SinhDecimalIeee754<Decimal32, uint>(x._value));
1070
public static Decimal32 Sqrt(Decimal32 x) => new Decimal32(
Number
.SqrtDecimalIeee754<Decimal32, uint>(x._value));
1073
public static Decimal32 Tan(Decimal32 x) => new Decimal32(
Number
.TanDecimalIeee754<Decimal32, uint>(x._value));
1076
public static Decimal32 TanPi(Decimal32 x) => new Decimal32(
Number
.TanPiDecimalIeee754<Decimal32, uint>(x._value));
1079
public static Decimal32 Tanh(Decimal32 x) => new Decimal32(
Number
.TanhDecimalIeee754<Decimal32, uint>(x._value));
1085
public static Decimal32 Quantize(Decimal32 x, Decimal32 y) => new Decimal32(
Number
.QuantizeDecimalIeee754<Decimal32, uint>(x._value, y._value));
1090
public static Decimal32 GetQuantum(Decimal32 x) => new Decimal32(
Number
.QuantumDecimalIeee754<Decimal32, uint>(x._value));
1096
public static bool HaveSameQuantum(Decimal32 x, Decimal32 y) =>
Number
.SameQuantumDecimalIeee754<Decimal32, uint>(x._value, y._value);
1101
public static Decimal32 Abs(Decimal32 value) => new Decimal32(
Number
.AbsDecimalIeee754<Decimal32, uint>(value._value));
1146
public static bool IsInteger(Decimal32 value) =>
Number
.IsIntegerDecimalIeee754<Decimal32, uint>(value._value);
1151
public static bool IsEvenInteger(Decimal32 value) =>
Number
.IsEvenIntegerDecimalIeee754<Decimal32, uint>(value._value);
1156
public static bool IsOddInteger(Decimal32 value) =>
Number
.IsOddIntegerDecimalIeee754<Decimal32, uint>(value._value);
1161
public static bool IsNormal(Decimal32 value) =>
Number
.IsNormalDecimalIeee754<Decimal32, uint>(value._value);
1166
public static bool IsSubnormal(Decimal32 value) =>
Number
.IsSubnormalDecimalIeee754<Decimal32, uint>(value._value);
1172
public static Decimal32 MaxMagnitude(Decimal32 x, Decimal32 y) => new Decimal32(
Number
.MaxMagnitudeDecimalIeee754<Decimal32, uint>(x._value, y._value));
1178
public static Decimal32 MaxMagnitudeNumber(Decimal32 x, Decimal32 y) => new Decimal32(
Number
.MaxMagnitudeNumberDecimalIeee754<Decimal32, uint>(x._value, y._value));
1184
public static Decimal32 MinMagnitude(Decimal32 x, Decimal32 y) => new Decimal32(
Number
.MinMagnitudeDecimalIeee754<Decimal32, uint>(x._value, y._value));
1190
public static Decimal32 MinMagnitudeNumber(Decimal32 x, Decimal32 y) => new Decimal32(
Number
.MinMagnitudeNumberDecimalIeee754<Decimal32, uint>(x._value, y._value));
1233
public static Decimal32 CopySign(Decimal32 value, Decimal32 sign) => new Decimal32(
Number
.CopySignDecimalIeee754<Decimal32, uint>(value._value, sign._value));
1239
public static Decimal32 Max(Decimal32 x, Decimal32 y) => new Decimal32(
Number
.MaxDecimalIeee754<Decimal32, uint>(x._value, y._value));
1245
public static Decimal32 MaxNative(Decimal32 x, Decimal32 y) => new Decimal32(
Number
.MaxNativeDecimalIeee754<Decimal32, uint>(x._value, y._value));
1251
public static Decimal32 MaxNumber(Decimal32 x, Decimal32 y) => new Decimal32(
Number
.MaxNumberDecimalIeee754<Decimal32, uint>(x._value, y._value));
1257
public static Decimal32 Min(Decimal32 x, Decimal32 y) => new Decimal32(
Number
.MinDecimalIeee754<Decimal32, uint>(x._value, y._value));
1263
public static Decimal32 MinNative(Decimal32 x, Decimal32 y) => new Decimal32(
Number
.MinNativeDecimalIeee754<Decimal32, uint>(x._value, y._value));
1269
public static Decimal32 MinNumber(Decimal32 x, Decimal32 y) => new Decimal32(
Number
.MinNumberDecimalIeee754<Decimal32, uint>(x._value, y._value));
1275
public static int Sign(Decimal32 value) =>
Number
.SignDecimalIeee754<Decimal32, uint>(value._value);
1281
static bool INumberBase<Decimal32>.IsCanonical(Decimal32 value) =>
Number
.IsCanonicalDecimalIeee754<Decimal32, uint>(value._value, nanReservedMask: 0x01F0_0000, nanPayloadMask: NaNPayloadMask, maxNaNPayload: 999_999);
1290
static bool INumberBase<Decimal32>.IsZero(Decimal32 value) =>
Number
.IsZeroDecimalIeee754<Decimal32, uint>(value._value);
1730
static int IDecimalIeee754ParseAndFormatInfo<Decimal32, uint>.BufferLength =>
Number
.Decimal32NumberBufferLength;
1734
return
Number
.UInt32ToDecStr(significand);
1737
static unsafe uint IDecimalIeee754ParseAndFormatInfo<Decimal32, uint>.NumberToSignificand(ref
Number
.NumberBuffer number, int digits)
1739
return
Number
.DigitsToUInt32(number.DigitsPtr, digits);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal64.cs (174)
144
return
Number
.ParseDecimalIeee754<char, Decimal64, ulong>(s, style, NumberFormatInfo.GetInstance(provider));
202
return
Number
.TryParseDecimalIeee754<char, Decimal64, ulong>(s, style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
216
return
Number
.TryParseDecimalIeee754<char, Decimal64, ulong>(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) ==
Number
.ParsingStatus.OK;
232
return
Number
.CompareDecimalIeee754<Decimal64, ulong>(_value, other._value);
238
return
Number
.CompareDecimalIeee754<Decimal64, ulong>(_value, other._value) == 0;
254
return
Number
.GetDecimalIeee754HashCode<Decimal64, ulong>(_value);
273
public static ulong EncodeDecimal(Decimal64 x) =>
Number
.EncodeDecimalIeee754<Decimal64, ulong>(x._value);
279
public static Decimal64 DecodeDecimal(ulong x) => new Decimal64(
Number
.DecodeDecimalIeee754<Decimal64, ulong>(x));
286
return
Number
.FormatDecimalIeee754<Decimal64, ulong>(_value, null, NumberFormatInfo.CurrentInfo);
294
return
Number
.FormatDecimalIeee754<Decimal64, ulong>(_value, format, NumberFormatInfo.CurrentInfo);
302
return
Number
.FormatDecimalIeee754<Decimal64, ulong>(_value, null, NumberFormatInfo.GetInstance(provider));
310
return
Number
.FormatDecimalIeee754<Decimal64, ulong>(_value, format, NumberFormatInfo.GetInstance(provider));
316
return
Number
.TryFormatDecimalIeee754<Decimal64, ulong, char>(_value, format, NumberFormatInfo.GetInstance(provider), destination, out charsWritten);
322
return
Number
.TryFormatDecimalIeee754<Decimal64, ulong, byte>(_value, format, NumberFormatInfo.GetInstance(provider), utf8Destination, out bytesWritten);
340
return new Decimal64(
Number
.AddDecimalIeee754<Decimal64, ulong>(value._value, OneValue));
348
return new Decimal64(
Number
.SubtractDecimalIeee754<Decimal64, ulong>(value._value, OneValue));
357
return new Decimal64(
Number
.AddDecimalIeee754<Decimal64, ulong>(left._value, right._value));
366
return new Decimal64(
Number
.SubtractDecimalIeee754<Decimal64, ulong>(left._value, right._value));
375
return new Decimal64(
Number
.MultiplyDecimalIeee754<Decimal64, ulong>(left._value, right._value));
384
return new Decimal64(
Number
.DivideDecimalIeee754<Decimal64, ulong>(left._value, right._value));
393
return new Decimal64(
Number
.RemainderDecimalIeee754<Decimal64, ulong>(left._value, right._value));
403
public static explicit operator Decimal64(nint value) => new Decimal64(
Number
.ConvertIntegerToDecimalIeee754<Decimal64, ulong, nint>(value));
409
public static explicit operator Decimal64(nuint value) => new Decimal64(
Number
.ConvertIntegerToDecimalIeee754<Decimal64, ulong, nuint>(value));
414
public static explicit operator Decimal64(long value) => new Decimal64(
Number
.ConvertIntegerToDecimalIeee754<Decimal64, ulong, long>(value));
420
public static explicit operator Decimal64(ulong value) => new Decimal64(
Number
.ConvertIntegerToDecimalIeee754<Decimal64, ulong, ulong>(value));
425
public static explicit operator Decimal64(Int128 value) => new Decimal64(
Number
.ConvertIntegerToDecimalIeee754<Decimal64, ulong, Int128>(value));
431
public static explicit operator Decimal64(UInt128 value) => new Decimal64(
Number
.ConvertIntegerToDecimalIeee754<Decimal64, ulong, UInt128>(value));
436
public static explicit operator Decimal64(Half value) => new Decimal64(
Number
.ConvertFloatToDecimalIeee754<Half, Decimal64, ulong>(value));
441
public static explicit operator Decimal64(float value) => new Decimal64(
Number
.ConvertFloatToDecimalIeee754<float, Decimal64, ulong>(value));
446
public static explicit operator Decimal64(double value) => new Decimal64(
Number
.ConvertFloatToDecimalIeee754<double, Decimal64, ulong>(value));
451
public static explicit operator Decimal64(Decimal128 value) => new Decimal64(
Number
.ConvertDecimalIeee754<Decimal128, UInt128, Decimal64, ulong>(new UInt128(value._upper, value._lower)));
456
public static explicit operator Decimal64(decimal value) => new Decimal64(
Number
.ConvertDecimalToDecimalIeee754<Decimal64, ulong>(value));
465
public static explicit operator byte(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, byte>(value._value, isChecked: false);
471
public static explicit operator checked byte(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, byte>(value._value, isChecked: true);
477
public static explicit operator sbyte(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, sbyte>(value._value, isChecked: false);
484
public static explicit operator checked sbyte(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, sbyte>(value._value, isChecked: true);
489
public static explicit operator char(Decimal64 value) => (char)
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, ushort>(value._value, isChecked: false);
495
public static explicit operator checked char(Decimal64 value) => (char)
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, ushort>(value._value, isChecked: true);
500
public static explicit operator short(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, short>(value._value, isChecked: false);
506
public static explicit operator checked short(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, short>(value._value, isChecked: true);
512
public static explicit operator ushort(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, ushort>(value._value, isChecked: false);
519
public static explicit operator checked ushort(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, ushort>(value._value, isChecked: true);
524
public static explicit operator int(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, int>(value._value, isChecked: false);
530
public static explicit operator checked int(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, int>(value._value, isChecked: true);
536
public static explicit operator uint(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, uint>(value._value, isChecked: false);
543
public static explicit operator checked uint(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, uint>(value._value, isChecked: true);
548
public static explicit operator nint(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, nint>(value._value, isChecked: false);
554
public static explicit operator checked nint(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, nint>(value._value, isChecked: true);
560
public static explicit operator nuint(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, nuint>(value._value, isChecked: false);
567
public static explicit operator checked nuint(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, nuint>(value._value, isChecked: true);
572
public static explicit operator long(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, long>(value._value, isChecked: false);
578
public static explicit operator checked long(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, long>(value._value, isChecked: true);
584
public static explicit operator ulong(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, ulong>(value._value, isChecked: false);
591
public static explicit operator checked ulong(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, ulong>(value._value, isChecked: true);
596
public static explicit operator Int128(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, Int128>(value._value, isChecked: false);
602
public static explicit operator checked Int128(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, Int128>(value._value, isChecked: true);
608
public static explicit operator UInt128(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, UInt128>(value._value, isChecked: false);
615
public static explicit operator checked UInt128(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToInteger<Decimal64, ulong, UInt128>(value._value, isChecked: true);
620
public static explicit operator Half(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToFloat<Decimal64, ulong, Half>(value._value);
625
public static explicit operator float(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToFloat<Decimal64, ulong, float>(value._value);
630
public static explicit operator double(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToFloat<Decimal64, ulong, double>(value._value);
636
public static explicit operator decimal(Decimal64 value) =>
Number
.ConvertDecimalIeee754ToDecimal<Decimal64, ulong>(value._value);
645
public static implicit operator Decimal64(byte value) => new Decimal64(
Number
.ConvertIntegerToDecimalIeee754<Decimal64, ulong, byte>(value));
651
public static implicit operator Decimal64(sbyte value) => new Decimal64(
Number
.ConvertIntegerToDecimalIeee754<Decimal64, ulong, sbyte>(value));
656
public static implicit operator Decimal64(char value) => new Decimal64(
Number
.ConvertIntegerToDecimalIeee754<Decimal64, ulong, ushort>(value));
661
public static implicit operator Decimal64(short value) => new Decimal64(
Number
.ConvertIntegerToDecimalIeee754<Decimal64, ulong, short>(value));
667
public static implicit operator Decimal64(ushort value) => new Decimal64(
Number
.ConvertIntegerToDecimalIeee754<Decimal64, ulong, ushort>(value));
672
public static implicit operator Decimal64(int value) => new Decimal64(
Number
.ConvertIntegerToDecimalIeee754<Decimal64, ulong, int>(value));
678
public static implicit operator Decimal64(uint value) => new Decimal64(
Number
.ConvertIntegerToDecimalIeee754<Decimal64, ulong, uint>(value));
687
public static implicit operator Decimal128(Decimal64 value) => new Decimal128(
Number
.ConvertDecimalIeee754<Decimal64, ulong, Decimal128, UInt128>(value._value));
695
return
Number
.EqualsDecimalIeee754<Decimal64, ulong>(left._value, right._value);
713
return
Number
.LessThanDecimalIeee754<Decimal64, ulong>(left._value, right._value);
722
return
Number
.GreaterThanDecimalIeee754<Decimal64, ulong>(left._value, right._value);
731
return
Number
.LessThanOrEqualDecimalIeee754<Decimal64, ulong>(left._value, right._value);
740
return
Number
.GreaterThanOrEqualDecimalIeee754<Decimal64, ulong>(left._value, right._value);
751
return
Number
.TryParseDecimalIeee754<char, Decimal64, ulong>(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
758
return
Number
.TryParseDecimalIeee754<char, Decimal64, ulong>(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) ==
Number
.ParsingStatus.OK;
765
return
Number
.TryParseDecimalIeee754<byte, Decimal64, ulong>(utf8Text, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out bytesConsumed) ==
Number
.ParsingStatus.OK;
780
return
Number
.ParseDecimalIeee754<byte, Decimal64, ulong>(utf8Text, style, NumberFormatInfo.GetInstance(provider));
787
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;
809
public static Decimal64 Ceiling(Decimal64 x) => new Decimal64(
Number
.RoundDecimalIeee754<Decimal64, ulong>(x._value, 0, MidpointRounding.ToPositiveInfinity));
820
public static Decimal64 Floor(Decimal64 x) => new Decimal64(
Number
.RoundDecimalIeee754<Decimal64, ulong>(x._value, 0, MidpointRounding.ToNegativeInfinity));
823
public static Decimal64 Round(Decimal64 x) => new Decimal64(
Number
.RoundDecimalIeee754<Decimal64, ulong>(x._value, 0, MidpointRounding.ToEven));
826
public static Decimal64 Round(Decimal64 x, int digits) => new Decimal64(
Number
.RoundDecimalIeee754<Decimal64, ulong>(x._value, digits, MidpointRounding.ToEven));
829
public static Decimal64 Round(Decimal64 x, MidpointRounding mode) => new Decimal64(
Number
.RoundDecimalIeee754<Decimal64, ulong>(x._value, 0, mode));
832
public static Decimal64 Round(Decimal64 x, int digits, MidpointRounding mode) => new Decimal64(
Number
.RoundDecimalIeee754<Decimal64, ulong>(x._value, digits, mode));
835
public static Decimal64 Truncate(Decimal64 x) => new Decimal64(
Number
.RoundDecimalIeee754<Decimal64, ulong>(x._value, 0, MidpointRounding.ToZero));
843
int exponent =
Number
.UnpackDecimalIeee754<Decimal64, ulong>(_value).UnbiasedExponent;
864
if (BinaryPrimitives.TryWriteInt32BigEndian(destination,
Number
.UnpackDecimalIeee754<Decimal64, ulong>(_value).UnbiasedExponent))
877
if (BinaryPrimitives.TryWriteInt32LittleEndian(destination,
Number
.UnpackDecimalIeee754<Decimal64, ulong>(_value).UnbiasedExponent))
890
if (BinaryPrimitives.TryWriteUInt64BigEndian(destination,
Number
.UnpackDecimalIeee754<Decimal64, ulong>(_value).Significand))
903
if (BinaryPrimitives.TryWriteUInt64LittleEndian(destination,
Number
.UnpackDecimalIeee754<Decimal64, ulong>(_value).Significand))
918
public static Decimal64 Acos(Decimal64 x) => new Decimal64(
Number
.AcosDecimalIeee754<Decimal64, ulong>(x._value));
921
public static Decimal64 AcosPi(Decimal64 x) => new Decimal64(
Number
.AcosPiDecimalIeee754<Decimal64, ulong>(x._value));
924
public static Decimal64 Acosh(Decimal64 x) => new Decimal64(
Number
.AcoshDecimalIeee754<Decimal64, ulong>(x._value));
927
public static Decimal64 Asin(Decimal64 x) => new Decimal64(
Number
.AsinDecimalIeee754<Decimal64, ulong>(x._value));
930
public static Decimal64 AsinPi(Decimal64 x) => new Decimal64(
Number
.AsinPiDecimalIeee754<Decimal64, ulong>(x._value));
933
public static Decimal64 Asinh(Decimal64 x) => new Decimal64(
Number
.AsinhDecimalIeee754<Decimal64, ulong>(x._value));
936
public static Decimal64 Atan(Decimal64 x) => new Decimal64(
Number
.AtanDecimalIeee754<Decimal64, ulong>(x._value));
939
public static Decimal64 Atan2(Decimal64 y, Decimal64 x) => new Decimal64(
Number
.Atan2DecimalIeee754<Decimal64, ulong>(y._value, x._value));
942
public static Decimal64 Atan2Pi(Decimal64 y, Decimal64 x) => new Decimal64(
Number
.Atan2PiDecimalIeee754<Decimal64, ulong>(y._value, x._value));
945
public static Decimal64 AtanPi(Decimal64 x) => new Decimal64(
Number
.AtanPiDecimalIeee754<Decimal64, ulong>(x._value));
948
public static Decimal64 Atanh(Decimal64 x) => new Decimal64(
Number
.AtanhDecimalIeee754<Decimal64, ulong>(x._value));
951
public static Decimal64 BitDecrement(Decimal64 x) => new Decimal64(
Number
.BitDecrementDecimalIeee754<Decimal64, ulong>(x._value));
954
public static Decimal64 BitIncrement(Decimal64 x) => new Decimal64(
Number
.BitIncrementDecimalIeee754<Decimal64, ulong>(x._value));
957
public static Decimal64 Cbrt(Decimal64 x) => new Decimal64(
Number
.CbrtDecimalIeee754<Decimal64, ulong>(x._value));
960
public static Decimal64 Cos(Decimal64 x) => new Decimal64(
Number
.CosDecimalIeee754<Decimal64, ulong>(x._value));
963
public static Decimal64 CosPi(Decimal64 x) => new Decimal64(
Number
.CosPiDecimalIeee754<Decimal64, ulong>(x._value));
966
public static Decimal64 Cosh(Decimal64 x) => new Decimal64(
Number
.CoshDecimalIeee754<Decimal64, ulong>(x._value));
969
public static Decimal64 Exp(Decimal64 x) => new Decimal64(
Number
.ExpDecimalIeee754<Decimal64, ulong>(x._value));
972
public static Decimal64 Exp10(Decimal64 x) => new Decimal64(
Number
.Exp10DecimalIeee754<Decimal64, ulong>(x._value));
975
public static Decimal64 Exp10M1(Decimal64 x) => new Decimal64(
Number
.Exp10M1DecimalIeee754<Decimal64, ulong>(x._value));
978
public static Decimal64 Exp2(Decimal64 x) => new Decimal64(
Number
.Exp2DecimalIeee754<Decimal64, ulong>(x._value));
981
public static Decimal64 Exp2M1(Decimal64 x) => new Decimal64(
Number
.Exp2M1DecimalIeee754<Decimal64, ulong>(x._value));
984
public static Decimal64 ExpM1(Decimal64 x) => new Decimal64(
Number
.ExpM1DecimalIeee754<Decimal64, ulong>(x._value));
987
public static Decimal64 FusedMultiplyAdd(Decimal64 left, Decimal64 right, Decimal64 addend) => new Decimal64(
Number
.FusedMultiplyAddDecimalIeee754<Decimal64, ulong>(left._value, right._value, addend._value));
990
public static Decimal64 Hypot(Decimal64 x, Decimal64 y) => new Decimal64(
Number
.HypotDecimalIeee754<Decimal64, ulong>(x._value, y._value));
993
public static Decimal64 Ieee754Remainder(Decimal64 left, Decimal64 right) => new Decimal64(
Number
.Ieee754RemainderDecimalIeee754<Decimal64, ulong>(left._value, right._value));
996
public static int ILogB(Decimal64 x) =>
Number
.ILogBDecimalIeee754<Decimal64, ulong>(x._value);
1002
public static Decimal64 Log(Decimal64 x) => new Decimal64(
Number
.LogDecimalIeee754<Decimal64, ulong>(x._value));
1005
public static Decimal64 Log(Decimal64 x, Decimal64 newBase) => new Decimal64(
Number
.LogDecimalIeee754<Decimal64, ulong>(x._value, newBase._value));
1008
public static Decimal64 Log10(Decimal64 x) => new Decimal64(
Number
.Log10DecimalIeee754<Decimal64, ulong>(x._value));
1011
public static Decimal64 Log10P1(Decimal64 x) => new Decimal64(
Number
.Log10P1DecimalIeee754<Decimal64, ulong>(x._value));
1014
public static Decimal64 Log2(Decimal64 x) => new Decimal64(
Number
.Log2DecimalIeee754<Decimal64, ulong>(x._value));
1017
public static Decimal64 Log2P1(Decimal64 x) => new Decimal64(
Number
.Log2P1DecimalIeee754<Decimal64, ulong>(x._value));
1020
public static Decimal64 LogP1(Decimal64 x) => new Decimal64(
Number
.LogP1DecimalIeee754<Decimal64, ulong>(x._value));
1023
public static Decimal64 Pow(Decimal64 x, Decimal64 y) => new Decimal64(
Number
.PowDecimalIeee754<Decimal64, ulong>(x._value, y._value));
1032
public static Decimal64 RootN(Decimal64 x, int n) => new Decimal64(
Number
.RootNDecimalIeee754<Decimal64, ulong>(x._value, n));
1035
public static Decimal64 ScaleB(Decimal64 x, int n) => new Decimal64(
Number
.ScaleBDecimalIeee754<Decimal64, ulong>(x._value, n));
1038
public static Decimal64 Sin(Decimal64 x) => new Decimal64(
Number
.SinDecimalIeee754<Decimal64, ulong>(x._value));
1043
(ulong sin, ulong cos) =
Number
.SinCosDecimalIeee754<Decimal64, ulong>(x._value);
1050
(ulong sin, ulong cos) =
Number
.SinCosPiDecimalIeee754<Decimal64, ulong>(x._value);
1055
public static Decimal64 SinPi(Decimal64 x) => new Decimal64(
Number
.SinPiDecimalIeee754<Decimal64, ulong>(x._value));
1058
public static Decimal64 Sinh(Decimal64 x) => new Decimal64(
Number
.SinhDecimalIeee754<Decimal64, ulong>(x._value));
1061
public static Decimal64 Sqrt(Decimal64 x) => new Decimal64(
Number
.SqrtDecimalIeee754<Decimal64, ulong>(x._value));
1064
public static Decimal64 Tan(Decimal64 x) => new Decimal64(
Number
.TanDecimalIeee754<Decimal64, ulong>(x._value));
1067
public static Decimal64 TanPi(Decimal64 x) => new Decimal64(
Number
.TanPiDecimalIeee754<Decimal64, ulong>(x._value));
1070
public static Decimal64 Tanh(Decimal64 x) => new Decimal64(
Number
.TanhDecimalIeee754<Decimal64, ulong>(x._value));
1076
public static Decimal64 Quantize(Decimal64 x, Decimal64 y) => new Decimal64(
Number
.QuantizeDecimalIeee754<Decimal64, ulong>(x._value, y._value));
1081
public static Decimal64 GetQuantum(Decimal64 x) => new Decimal64(
Number
.QuantumDecimalIeee754<Decimal64, ulong>(x._value));
1087
public static bool HaveSameQuantum(Decimal64 x, Decimal64 y) =>
Number
.SameQuantumDecimalIeee754<Decimal64, ulong>(x._value, y._value);
1092
public static Decimal64 Abs(Decimal64 value) => new Decimal64(
Number
.AbsDecimalIeee754<Decimal64, ulong>(value._value));
1137
public static bool IsInteger(Decimal64 value) =>
Number
.IsIntegerDecimalIeee754<Decimal64, ulong>(value._value);
1142
public static bool IsEvenInteger(Decimal64 value) =>
Number
.IsEvenIntegerDecimalIeee754<Decimal64, ulong>(value._value);
1147
public static bool IsOddInteger(Decimal64 value) =>
Number
.IsOddIntegerDecimalIeee754<Decimal64, ulong>(value._value);
1152
public static bool IsNormal(Decimal64 value) =>
Number
.IsNormalDecimalIeee754<Decimal64, ulong>(value._value);
1157
public static bool IsSubnormal(Decimal64 value) =>
Number
.IsSubnormalDecimalIeee754<Decimal64, ulong>(value._value);
1163
public static Decimal64 MaxMagnitude(Decimal64 x, Decimal64 y) => new Decimal64(
Number
.MaxMagnitudeDecimalIeee754<Decimal64, ulong>(x._value, y._value));
1169
public static Decimal64 MaxMagnitudeNumber(Decimal64 x, Decimal64 y) => new Decimal64(
Number
.MaxMagnitudeNumberDecimalIeee754<Decimal64, ulong>(x._value, y._value));
1175
public static Decimal64 MinMagnitude(Decimal64 x, Decimal64 y) => new Decimal64(
Number
.MinMagnitudeDecimalIeee754<Decimal64, ulong>(x._value, y._value));
1181
public static Decimal64 MinMagnitudeNumber(Decimal64 x, Decimal64 y) => new Decimal64(
Number
.MinMagnitudeNumberDecimalIeee754<Decimal64, ulong>(x._value, y._value));
1224
public static Decimal64 CopySign(Decimal64 value, Decimal64 sign) => new Decimal64(
Number
.CopySignDecimalIeee754<Decimal64, ulong>(value._value, sign._value));
1230
public static Decimal64 Max(Decimal64 x, Decimal64 y) => new Decimal64(
Number
.MaxDecimalIeee754<Decimal64, ulong>(x._value, y._value));
1236
public static Decimal64 MaxNative(Decimal64 x, Decimal64 y) => new Decimal64(
Number
.MaxNativeDecimalIeee754<Decimal64, ulong>(x._value, y._value));
1242
public static Decimal64 MaxNumber(Decimal64 x, Decimal64 y) => new Decimal64(
Number
.MaxNumberDecimalIeee754<Decimal64, ulong>(x._value, y._value));
1248
public static Decimal64 Min(Decimal64 x, Decimal64 y) => new Decimal64(
Number
.MinDecimalIeee754<Decimal64, ulong>(x._value, y._value));
1254
public static Decimal64 MinNative(Decimal64 x, Decimal64 y) => new Decimal64(
Number
.MinNativeDecimalIeee754<Decimal64, ulong>(x._value, y._value));
1260
public static Decimal64 MinNumber(Decimal64 x, Decimal64 y) => new Decimal64(
Number
.MinNumberDecimalIeee754<Decimal64, ulong>(x._value, y._value));
1266
public static int Sign(Decimal64 value) =>
Number
.SignDecimalIeee754<Decimal64, ulong>(value._value);
1272
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);
1281
static bool INumberBase<Decimal64>.IsZero(Decimal64 value) =>
Number
.IsZeroDecimalIeee754<Decimal64, ulong>(value._value);
1721
static int IDecimalIeee754ParseAndFormatInfo<Decimal64, ulong>.BufferLength =>
Number
.Decimal64NumberBufferLength;
1725
return
Number
.UInt64ToDecStr(significand);
1728
static unsafe ulong IDecimalIeee754ParseAndFormatInfo<Decimal64, ulong>.NumberToSignificand(ref
Number
.NumberBuffer number, int digits)
1730
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);
2231
return
Number
.ParseFloat<byte, float>(utf8Text, style, NumberFormatInfo.GetInstance(provider));
2238
return
Number
.TryParseFloat(utf8Text, style, NumberFormatInfo.GetInstance(provider), out result, out _);
2251
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)
1178
return
Number
.TryParseBinaryInteger(s.AsSpan(), style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out Unsafe.As<nuint, nuint_t>(ref result), out charsConsumed) ==
Number
.ParsingStatus.OK;
1186
return
Number
.TryParseBinaryInteger(s, style |
Number
.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out Unsafe.As<nuint, nuint_t>(ref result), out charsConsumed) ==
Number
.ParsingStatus.OK;
1194
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>();