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

◆ Parse() [5/13]

static short System.Int16.Parse ( ReadOnlySpan< char > s,
NumberStyles style,
NumberFormatInfo info )
inlinestaticprivate

Definition at line 147 of file Int16.cs.

148 {
149 int result;
150 Number.ParsingStatus parsingStatus = Number.TryParseInt32(s, style, info, out result);
151 if (parsingStatus != 0)
152 {
153 Number.ThrowOverflowOrFormatException(parsingStatus, TypeCode.Int16);
154 }
155 if ((uint)(result - -32768 - ((int)(style & NumberStyles.AllowHexSpecifier) << 6)) > 65535u)
156 {
157 Number.ThrowOverflowException(TypeCode.Int16);
158 }
159 return (short)result;
160 }

References System.info, System.s, System.Number.ThrowOverflowException(), System.Number.ThrowOverflowOrFormatException(), and System.Number.TryParseInt32().