- for Long values, the conversion from long to double can lead to loss of precision. Eg.

```
SELECT  CAST(ROUND(922337203685477580) AS LONG) as a
```

returns

```
922337203685477632
```

- for floating point values, when the two numbers passed to ROUND() funciton are too big, the values are truncated to Long.MAX_VALUE and hence wrongly rounded. Eg.

```
SELECT  ROUND(100000000000.0, 8) as a
```

returns

```
9.223372036854776E10
```
x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/function/scalar/math/BinaryOptionalMathProcessor.java
if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        BinaryOptionalMathProcessor other = (BinaryOptionalMathProcessor) obj;
        return Objects.equals(left(), other.left())
            && Objects.equals(right(), other.right())
            && Objects.equals(operation(), other.operation());
    }
    @Override
    public int hashCode() {
        return Objects.hash(left(), right(), operation());
    }
    public Processor left() {
        return left;
    }
    public Processor right() {
        return right;
    }
    public BinaryOptionalMathOperation operation() {
        return operation;
    }
    @Override
    public String getWriteableName() {
        return NAME;
    }
}