Describe the bug
When atan2 is invoked with integer arguments, the input is coerced to Float32 (not Float64 as the comments in the implementation suggest). This results in losing precision unnecessarily and produces inconsistent results with DuckDB and Postgres.
To Reproduce
> select atan2(1, 1000000);
+--------------------------------+
| atan2(Int64(1),Int64(1000000)) |
+--------------------------------+
| 0.000001 |
+--------------------------------+
1 row(s) fetched.
Elapsed 0.084 seconds.
> select atan2(1.0, 1000000.0);
+------------------------------------+
| atan2(Float64(1),Float64(1000000)) |
+------------------------------------+
| 9.999999999996666e-7 |
+------------------------------------+
1 row(s) fetched.
Elapsed 0.006 seconds.
Expected behavior
DuckDB and Postgres both return 9.999999999996666e-7, matching the DataFusion behavior for Float64 input.
Additional context
No response
Describe the bug
When
atan2is invoked with integer arguments, the input is coerced toFloat32(notFloat64as the comments in the implementation suggest). This results in losing precision unnecessarily and produces inconsistent results with DuckDB and Postgres.To Reproduce
Expected behavior
DuckDB and Postgres both return
9.999999999996666e-7, matching the DataFusion behavior forFloat64input.Additional context
No response