Newtonsoft.Json.JsonTextReader.ParseNumberNegativeInfinity C# (CSharp) Method

ParseNumberNegativeInfinity() private method

private ParseNumberNegativeInfinity ( ReadType readType ) : object
readType ReadType
return object
        private object ParseNumberNegativeInfinity(ReadType readType)
        {
            if (MatchValueWithTrailingSeparator(JsonConvert.NegativeInfinity))
            {
                switch (readType)
                {
                    case ReadType.Read:
                    case ReadType.ReadAsDouble:
                        if (_floatParseHandling == FloatParseHandling.Double)
                        {
                            SetToken(JsonToken.Float, double.NegativeInfinity);
                            return double.NegativeInfinity;
                        }
                        break;
                    case ReadType.ReadAsString:
                        SetToken(JsonToken.String, JsonConvert.NegativeInfinity);
                        return JsonConvert.NegativeInfinity;
                }

                throw JsonReaderException.Create(this, "Cannot read -Infinity value.");
            }

            throw JsonReaderException.Create(this, "Error parsing -Infinity value.");
        }