Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ TryParseNormalAsFloatingPoint()

static bool System.Buffers.Text.Utf8Parser.TryParseNormalAsFloatingPoint ( ReadOnlySpan< byte > source,
ref Number::NumberBuffer number,
out int bytesConsumed,
char standardFormat )
inlinestaticprivate

Definition at line 1029 of file Utf8Parser.cs.

1030 {
1032 switch (standardFormat)
1033 {
1034 case '\0':
1035 case 'E':
1036 case 'G':
1037 case 'e':
1038 case 'g':
1039 options = ParseNumberOptions.AllowExponent;
1040 break;
1041 case 'F':
1042 case 'f':
1044 break;
1045 default:
1046 return ParserHelpers.TryParseThrowFormatException(out bytesConsumed);
1047 }
1048 if (!TryParseNumber(source, ref number, out bytesConsumed, options, out var textUsedExponentNotation))
1049 {
1050 return false;
1051 }
1052 if (!textUsedExponentNotation && (standardFormat == 'E' || standardFormat == 'e'))
1053 {
1054 bytesConsumed = 0;
1055 return false;
1056 }
1057 return true;
1058 }
static bool TryParseNumber(ReadOnlySpan< byte > source, ref Number.NumberBuffer number, out int bytesConsumed, ParseNumberOptions options, out bool textUsedExponentNotation)

References System.options, System.source, System.Buffers.Text.Utf8Parser.TryParseNumber(), and System.Buffers.Text.ParserHelpers.TryParseThrowFormatException().

Referenced by System.Buffers.Text.Utf8Parser.TryParse(), and System.Buffers.Text.Utf8Parser.TryParse().