internal static bool TryParseBigInteger(string value, NumberStyles style, NumberFormatInfo info, out BigInteger result)
{
unsafe
{
result = BigInteger.Zero;
ArgumentException e;
if (!TryValidateParseStyleInteger(style, out e))
throw e; // TryParse still throws ArgumentException on invalid NumberStyles
BigNumberBuffer bignumber = BigNumberBuffer.Create();
if (!FormatProvider.TryStringToBigInteger(value, style, info, bignumber.digits, out bignumber.precision, out bignumber.scale, out bignumber.sign))
return false;
if ((style & NumberStyles.AllowHexSpecifier) != 0)
{
if (!HexNumberToBigInteger(ref bignumber, ref result))
{
return false;
}
}
else
{
if (!NumberToBigInteger(ref bignumber, ref result))
{
return false;
}
}
return true;
}
}