You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 44b194b
Browse filesBrowse the repository at this point in the historyBrowse files
// Digits, plus the padding zeros implied by the exponent, plus the sign, the decimal
542
+
// separator and a possible leading "0". Widened, because an exponent of int.MinValue has
543
+
// no negation that fits an int and one near int.MaxValue would wrap the sum.
544
+
longbound=SignificantDigits
545
+
+long.Abs(Exponent)
546
+
+numberFormat.NegativeSign.Length
547
+
+numberFormat.NumberDecimalSeparator.Length
548
+
+1;
549
+
550
+
if(bound>Array.MaxLength)
551
+
{
552
+
thrownewOverflowException(
553
+
$"An exponent of {Exponent.ToString(InvariantCulture)} needs more characters in fixed point notation than a string can hold.");
554
+
}
555
+
556
+
returnbound;
557
+
}
558
+
536
559
/// <summary>
537
560
/// Returns the absolute value of the current instance.
538
561
/// </summary>
@@ -1351,13 +1374,20 @@ public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out
1351
1374
TryParse(s,NumberStyles.Any,provider,outresult);
1352
1375
1353
1376
/// <inheritdoc/>
1377
+
/// <exception cref="OverflowException">Thrown when the text would be longer than any string can hold, whatever the size of <paramref name="destination"/>.</exception>
0 commit comments