-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
According to the Binary GCD algorithm, its result cannot be a negative number.
To Reproduce
DataFusion CLI v39.0.0
> select gcd(-100, 0), gcd(0, -100);
+---------------------------+---------------------------+
| gcd(Int64(-100),Int64(0)) | gcd(Int64(0),Int64(-100)) |
+---------------------------+---------------------------+
| -100 | -100 |
+---------------------------+---------------------------+Expected behavior
In PostgreSQL
postgres=# select gcd(-100, 0), gcd(0, -100);
gcd | gcd
-----+-----
100 | 100
(1 row)Additional context
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working