Exemplo n.º 1
0
        public int Compare(bool leftExists, ReadOnlySpan <byte> left, bool rightExists, ReadOnlySpan <byte> right)
        {
            double leftValue  = leftExists ? ScalarSpanReader.ReadDouble(left) : this.defaultValue;
            double rightValue = rightExists ? ScalarSpanReader.ReadDouble(right) : this.defaultValue;

            return(leftValue.CompareTo(rightValue));
        }
Exemplo n.º 2
0
        public int Compare(bool leftExists, ReadOnlySpan <byte> left, bool rightExists, ReadOnlySpan <byte> right)
        {
            if (!leftExists || !rightExists)
            {
                return(leftExists.CompareTo(rightExists));
            }

            return(ScalarSpanReader.ReadDouble(left).CompareTo(ScalarSpanReader.ReadDouble(right)));
        }
Exemplo n.º 3
0
 public override double ReadDouble(int offset)
 {
     CheckAlignment(offset, sizeof(double));
     return(ScalarSpanReader.ReadDouble(this.memory.AsSpan().Slice(offset)));
 }
Exemplo n.º 4
0
 public int Compare(ReadOnlySpan <byte> left, ReadOnlySpan <byte> right)
 => ScalarSpanReader.ReadDouble(left).CompareTo(ScalarSpanReader.ReadDouble(right));
Exemplo n.º 5
0
 public override double ReadDouble(int offset)
 {
     return(ScalarSpanReader.ReadDouble(this.memory.AsSpan().Slice(offset)));
 }