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

◆ TryGetFloatingPointConstant() [2/2]

static bool System.Text.Json.JsonReaderHelper.TryGetFloatingPointConstant ( ReadOnlySpan< byte > span,
out float value )
inlinestatic

Definition at line 262 of file JsonReaderHelper.cs.

263 {
264 if (span.Length == 3)
265 {
266 if (span.SequenceEqual(JsonConstants.NaNValue))
267 {
268 value = float.NaN;
269 return true;
270 }
271 }
272 else if (span.Length == 8)
273 {
274 if (span.SequenceEqual(JsonConstants.PositiveInfinityValue))
275 {
276 value = float.PositiveInfinity;
277 return true;
278 }
279 }
280 else if (span.Length == 9 && span.SequenceEqual(JsonConstants.NegativeInfinityValue))
281 {
282 value = float.NegativeInfinity;
283 return true;
284 }
285 value = 0f;
286 return false;
287 }

References System.Text.Json.Dictionary, System.Text.Json.JsonConstants.NaNValue, System.Text.Json.JsonConstants.NegativeInfinityValue, System.Text.Json.JsonConstants.PositiveInfinityValue, and System.value.

Referenced by System.Text.Json.Utf8JsonReader.GetDoubleFloatingPointConstant(), System.Text.Json.Utf8JsonReader.GetDoubleWithQuotes(), System.Text.Json.Utf8JsonReader.GetSingleFloatingPointConstant(), and System.Text.Json.Utf8JsonReader.GetSingleWithQuotes().