Test if either left or right are either a Float or Double.

@param left
one object to test
@param right
the other
@return the result of the test.
341764
protected boolean isFloatingPointType(Object left, Object right) {
    return left instanceof Float || left instanceof Double || right instanceof Float || right instanceof Double;
  }
1014250
public Object add(Object left, Object right, ParserRuleContext errCtx) {
    if (left == null && right == null) {
      return 0;
    }

    // if either are collections... concatenate them
    if (left instanceof Collection<?> || right instanceof Collection<?>) {
      List<Object> res = newArrayList();
      res.addAll(toCollection(left));
      res.addAll(toCollection(right));
      return res;
    }

    // if either are strings... concatenate them
    if (left instanceof String || right instanceof String) {
      return toString(left).concat(toString(right));
    }

    // if both are maps... concatenate them
    if (left instanceof Map<?, ?> || right instanceof Map<?, ?>) {
      Map<Object, Object> res = newHashMap();
      res.putAll((Map<?, ?>) left);
      res.putAll((Map<?, ?>) right);
      return res;
    }

    try {

      // if either are floating point (double or float) use double
      if (isFloatingPointNumber(left) || isFloatingPointNumber(right)) {
        double l = toDouble(left);
        double r = toDouble(right);
        return new Double(l + r);
      }

      // if either are bigdecimal use that type
      if (left instanceof BigDecimal || right instanceof BigDecimal) {
        BigDecimal l = toBigDecimal(left);
        BigDecimal r = toBigDecimal(right);
        BigDecimal result = l.add(r, getMathContext());
        return narrowBigDecimal(left, right, result);
      }

      // if either are numbers use integers
      if (left instanceof Number || right instanceof Number) {
        BigInteger l = toBigInteger(left);
        BigInteger r = toBigInteger(right);
        BigInteger result = l.add(r);
        return narrowBigInteger(left, right, result);
      }

    }
    catch (java.lang.NumberFormatException nfe) {
    }

    throw new ExecutionException("invalid operands for +", interpreter.getLocation(errCtx));
  }
1139545
private static TernaryValue tryStrictEqualityComparison(Node left, Node right) {
    // First, try to evaluate based on the general type.
    ValueType leftValueType = NodeUtil.getKnownValueType(left);
    ValueType rightValueType = NodeUtil.getKnownValueType(right);
    if (leftValueType != ValueType.UNDETERMINED && rightValueType != ValueType.UNDETERMINED) {
      // Strict equality can only be true for values of the same type.
      if (leftValueType != rightValueType) {
        return TernaryValue.FALSE;
      }
      switch (leftValueType) {
        case VOID:
        case NULL:
          return TernaryValue.TRUE;
        case NUMBER: {
          if (NodeUtil.isNaN(left)) {
            return TernaryValue.FALSE;
          }
          if (NodeUtil.isNaN(right)) {
            return TernaryValue.FALSE;
          }
          Double lv = NodeUtil.getNumberValue(left);
          Double rv = NodeUtil.getNumberValue(right);
          if (lv != null && rv != null) {
            return TernaryValue.forBoolean(lv.doubleValue() == rv.doubleValue());
          }
          break;
        }
        case STRING: {
          String lv = NodeUtil.getStringValue(left);
          String rv = NodeUtil.getStringValue(right);
          if (lv != null && rv != null) {
            // In JS, browsers parse \v differently. So do not consider strings
            // equal if one contains \v.
            if (lv.indexOf('\u000B') != -1 || rv.indexOf('\u000B') != -1) {
              return TernaryValue.UNKNOWN;
            } else {
              return lv.equals(rv) ? TernaryValue.TRUE : TernaryValue.FALSE;
            }
          } else if (left.isTypeOf() && right.isTypeOf()
              && left.getFirstChild().isName() && right.getFirstChild().isName()
              && left.getFirstChild().getString().equals(right.getFirstChild().getString())) {
            // Special case, typeof a == typeof a is always true.
            return TernaryValue.TRUE;
          }
          break;
        }
        case BOOLEAN: {
          TernaryValue lv = NodeUtil.getPureBooleanValue(left);
          TernaryValue rv = NodeUtil.getPureBooleanValue(right);
          return lv.and(rv).or(lv.not().and(rv.not()));
        }
        default: // Symbol and Object cannot be folded in the general case.
          return TernaryValue.UNKNOWN;
      }
    }

    // Then, try to evaluate based on the value of the node. There's only one special case:
    // Any strict equality comparison against NaN returns false.
    if (NodeUtil.isNaN(left) || NodeUtil.isNaN(right)) {
      return TernaryValue.FALSE;
    }
    return TernaryValue.UNKNOWN;
  }
971876
@Pure
	@Inline(value = "($1 != null && ($1.shortValue() == $2))", constantExpression = true)
	public static boolean operator_equals(Short left, long right) {
		return left != null ? left.shortValue() == right : false;
	}
662527
@NonNull
  public static Term divide(@NonNull Term left, @NonNull Term right) {
    return new BinaryArithmeticTerm(ArithmeticOperator.QUOTIENT, left, right);
  }
1121026
public static Number multiply(Number left, Number right) {
        return NumberMath.multiply(left, right);
    }
1142478
public boolean lessThanOrEqual(Object left, Object right) {
    if (left == right) {
      return true;
    }
    else if (left == null || right == null) {
      return false;
    }
    else {
      return compare(left, right, "<=") <= 0;
    }
  }
216298
@Pure
	@Inline(value = "$3.pow($1.floatValue(), $2)", imported = Math.class)
	public static double operator_power(Float left, long right) {
		return Math.pow(left.floatValue(), right);
	}
687566
def Division(left: vertex_constructor_param_types, right: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
    
    return Double(context.jvm_view().DivisionVertex, label, cast_to_double_vertex(left), cast_to_double_vertex(right))
635262
public static int compareFlags(int left, int right) {
		if (left == right) {
			return 0;
		}
		int leftSuccess = left & SUCCESS_OR_LAMBDA;
		int rightSuccess = right & SUCCESS_OR_LAMBDA;
		if (leftSuccess != rightSuccess) {
			if (leftSuccess == 0)
				return 1;
			if (rightSuccess == 0)
				return -1;
			if (leftSuccess < rightSuccess)
				return -1;
			return 1;
		}
		if ((left & SYNONYM) != (right & SYNONYM)) {
			if ((left & SYNONYM) != 0)
				return 1;
			return -1;
		}
		return 0;
	}
838768
public static <S, T> Either<S, T> left(S left) {
    return new Left<>(left);
  }
351393
def Multiplication(left: vertex_constructor_param_types, right: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
    
    return Double(context.jvm_view().MultiplicationVertex, label, cast_to_double_vertex(left), cast_to_double_vertex(right))
1071481
def _calculate_operation_math(self, rule, left, right):
        

        # Attempt to keep integer data type for the result, when possible.
        if isinstance(left, IntegerRule) and isinstance(right, IntegerRule):
            result = self.evaluate_binop_math(rule.operation, left.value, right.value)
            if isinstance(result, list):
                return ListRule([IntegerRule(r) for r in result])
            return IntegerRule(result)

        # Otherwise the result is float.
        if isinstance(left, NumberRule) and isinstance(right, NumberRule):
            result = self.evaluate_binop_math(rule.operation, left.value, right.value)
            if isinstance(result, list):
                return ListRule([FloatRule(r) for r in result])
            return FloatRule(result)

        # This point should never be reached.
        raise Exception()
99614
public boolean greaterThanOrEqual(Object left, Object right) {
    if (left == right) {
      return true;
    }
    else if (left == null || right == null) {
      return false;
    }
    else {
      return compare(left, right, ">=") >= 0;
    }
  }
1051349
def compare(cls, left, right):
        
        # First compare the types.
        leftType = TypeOrder.from_value(left).value
        rightType = TypeOrder.from_value(right).value

        if leftType != rightType:
            if leftType < rightType:
                return -1
            return 1

        value_type = left.WhichOneof("value_type")

        if value_type == "null_value":
            return 0  # nulls are all equal
        elif value_type == "boolean_value":
            return cls._compare_to(left.boolean_value, right.boolean_value)
        elif value_type == "integer_value":
            return cls.compare_numbers(left, right)
        elif value_type == "double_value":
            return cls.compare_numbers(left, right)
        elif value_type == "timestamp_value":
            return cls.compare_timestamps(left, right)
        elif value_type == "string_value":
            return cls._compare_to(left.string_value, right.string_value)
        elif value_type == "bytes_value":
            return cls.compare_blobs(left, right)
        elif value_type == "reference_value":
            return cls.compare_resource_paths(left, right)
        elif value_type == "geo_point_value":
            return cls.compare_geo_points(left, right)
        elif value_type == "array_value":
            return cls.compare_arrays(left, right)
        elif value_type == "map_value":
            return cls.compare_objects(left, right)
        else:
            raise ValueError("Unknown ``value_type``", str(value_type))
921768
@NonNull
  public static Term subtract(@NonNull Term left, @NonNull Term right) {
    return new BinaryArithmeticTerm(ArithmeticOperator.DIFFERENCE, left, right);
  }
470726
public static boolean isNewerThan(final Version left, final Version right) {

	// major
	if (left.getMajor() > right.getMajor()) return true;
	if (left.getMajor() < right.getMajor()) return false;

	// minor
	if (left.getMinor() > right.getMinor()) return true;
	if (left.getMinor() < right.getMinor()) return false;

	// micro
	if (left.getMicro() > right.getMicro()) return true;
	if (left.getMicro() < right.getMicro()) return false;

	// qualifier
	// left
	String q = left.getQualifier();
	int index = q.indexOf('-');
	String qla = index == -1 ? "" : q.substring(index + 1).trim();
	String qln = index == -1 ? q : q.substring(0, index);
	int ql = isEmpty(qln) ? Integer.MIN_VALUE : Integer.parseInt(qln);

	// right
	q = right.getQualifier();
	index = q.indexOf('-');
	String qra = index == -1 ? "" : q.substring(index + 1).trim();
	String qrn = index == -1 ? q : q.substring(0, index);
	int qr = isEmpty(qln) ? Integer.MIN_VALUE : Integer.parseInt(qrn);

	if (ql > qr) return true;
	if (ql < qr) return false;

	int qlan = qualifierAppendix2Number(qla);
	int qran = qualifierAppendix2Number(qra);

	if (qlan > qran) return true;
	if (qlan < qran) return false;

	if (qlan == QUALIFIER_APPENDIX_OTHER && qran == QUALIFIER_APPENDIX_OTHER) return left.compareTo(right) > 0;

	return false;
    }