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

◆ TryGetFloatingPointConstant() [1/2]

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

Definition at line 289 of file JsonReaderHelper.cs.

290 {
291 if (span.Length == 3)
292 {
293 if (span.SequenceEqual(JsonConstants.NaNValue))
294 {
295 value = double.NaN;
296 return true;
297 }
298 }
299 else if (span.Length == 8)
300 {
301 if (span.SequenceEqual(JsonConstants.PositiveInfinityValue))
302 {
303 value = double.PositiveInfinity;
304 return true;
305 }
306 }
307 else if (span.Length == 9 && span.SequenceEqual(JsonConstants.NegativeInfinityValue))
308 {
309 value = double.NegativeInfinity;
310 return true;
311 }
312 value = 0.0;
313 return false;
314 }

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