private Result evaluateEquals(Object lhs, Object rhs) {
        if (lhs == null || rhs == null) {
            return Result.toResult(lhs == rhs);
        }
        // If either side is a tensor field, the result is Invalid (no peeking inside tensors)
        if (lhs instanceof TensorFieldValue || rhs instanceof TensorFieldValue) {
            return Result.INVALID;
        }

        double a = getAsNumber(lhs);
        double b = getAsNumber(rhs);
        if (Double.isNaN(a) || Double.isNaN(b)) {
            return Result.toResult(lhs.toString().equals(rhs.toString()));
        }
        return Result.toResult(a == b); // Ugh, comparing doubles? Should be converted to long value perhaps...
    }
Compare two operands for equality.

@param lhs Left hand side of operation.
@param rhs Right hand side of operation.
@return Wether or not the two operands are equal.
document/src/main/java/com/yahoo/document/select/rule/ComparisonNode.java