Method Parse
Parse(ReadOnlySpan<Char>, IFormatProvider)
Converts the representation of a number, contained in the specified read-only span of characters to its BigRational equivalent.
Declaration
public static BigRational Parse(ReadOnlySpan<char> value, IFormatProvider provider = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.ReadOnlySpan<System.Char> | value | A read-only span of characters that contains the number to convert. |
| System.IFormatProvider | provider | An object that provides culture-specific formatting information about value. |
Returns
| Type | Description |
|---|---|
| BigRational | A value that is equivalent to the number specified in the value parameter. |
Remarks
Like System.Double.Parse(System.String) but with unlimited number of digits.
Additional: Converts Fraction notation like "1/3" or "-123/456"
Additional: Converts Repetions like "0.'3", see: ToString(String, IFormatProvider).
Ignores spaces, underscores (_) leading dots (…)
Parse(String, NumberStyles, IFormatProvider)
Parses a string into a value.
Declaration
public static BigRational Parse(string s, NumberStyles style, IFormatProvider provider = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | s | The string to parse. |
| System.Globalization.NumberStyles | style | A bitwise combination of number styles that can be present in |
| System.IFormatProvider | provider | An object that provides culture-specific formatting information about |
Returns
| Type | Description |
|---|---|
| BigRational | The result of parsing |
Remarks
Part of the new NET 7 number type system.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException |
|
| System.ArgumentNullException |
|
| System.FormatException |
|
| System.OverflowException |
|
Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider)
Parses a span of characters into a value.
Declaration
public static BigRational Parse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider provider)
Parameters
| Type | Name | Description |
|---|---|---|
| System.ReadOnlySpan<System.Char> | s | The span of characters to parse. |
| System.Globalization.NumberStyles | style | A bitwise combination of number styles that can be present in |
| System.IFormatProvider | provider | An object that provides culture-specific formatting information about |
Returns
| Type | Description |
|---|---|
| BigRational | The result of parsing |
Remarks
Part of the new NET 7 number type system.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException |
|
| System.FormatException |
|
| System.OverflowException |
|
Parse(String, IFormatProvider)
Parses a string into a value.
Declaration
public static BigRational Parse(string s, IFormatProvider provider)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | s | The string to parse. |
| System.IFormatProvider | provider | An object that provides culture-specific formatting information about |
Returns
| Type | Description |
|---|---|
| BigRational | The result of parsing |
Remarks
Part of the new NET 7 number type system.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException |
|
| System.FormatException |
|
| System.OverflowException |
|