Exemplo n.º 1
0
        protected bool Equals(LazyDoubleValue other)
        {
            if (_val != null && other._val != null)
            {
                return(Math.Abs(_val.Value - other._val.Value) < double.Epsilon);
            }

            if (_decimalVal != null && other._decimalVal != null)
            {
                return(_decimalVal.Value.Equals(other._decimalVal.Value));
            }

            return(Inner.Equals(other.Inner));
        }
        public void WriteValue(LazyDoubleValue value)
        {
            var currentState = _continuationState.Pop();
            var valuePos     = _writer.WriteValue(value);

            _writeToken = new WriteToken //todo: figure out if we really need those WriteTokens
            {
                ValuePos     = valuePos,
                WrittenToken = BlittableJsonToken.Float
            };

            if (currentState.FirstWrite == -1)
            {
                currentState.FirstWrite = valuePos;
            }

            currentState = FinishWritingScalarValue(currentState);
            _continuationState.Push(currentState);
        }
Exemplo n.º 3
0
        public unsafe void WriteDouble(LazyDoubleValue val)
        {
            var lazyStringValue = val.Inner;

            WriteRawString(lazyStringValue.Buffer, lazyStringValue.Size);
        }
Exemplo n.º 4
0
 public int WriteValue(LazyDoubleValue value)
 {
     return(WriteValue(value.Inner));
 }