Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

float comparison bug #3577

Closed
czpmango opened this issue Dec 28, 2021 · 1 comment
Closed

float comparison bug #3577

czpmango opened this issue Dec 28, 2021 · 1 comment
Labels
type/bug Type: something is unexpected

Comments

@czpmango
Copy link
Contributor

Describe the bug (required)
Floating point comparison is not precise.

Your Environments (required)
v2.6.1 and previous versions.

How To Reproduce(required)

(czp@nebula) [nba]>    MATCH p = (n:player)<-[e:like]-(m)       WHERE n.age >= 33.0000000000011         RETURN n.name AS player, n.age AS age limit 3
+---------------------+-----+
| player              | age |
+---------------------+-----+
| "LaMarcus Aldridge" | 33  |
| "LaMarcus Aldridge" | 33  |
| "Chris Paul"        | 33  |
+---------------------+-----+

Expected behavior
n.age >= 33.0000000000011

@czpmango czpmango added the type/bug Type: something is unexpected label Dec 28, 2021
@czpmango
Copy link
Contributor Author

Not a bug, closed.
Test in neo4j 4.2.4 version:

neo4j@neo4j> create (:player{age:33});
0 rows available after 23 ms, consumed after another 0 ms

neo4j@neo4j>     MATCH p = (n:player) WHERE n.age >= 33.000000000000000011  and n.age=33      RETURN n.age;
+-------+
| n.age |
+-------+
| 33    |
+-------+

neo4j@neo4j>     MATCH p = (n:player) WHERE n.age >= 33.0000000000011  and n.age=33      RETURN n.age;
+-------+
| n.age |
+-------+
+-------+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Type: something is unexpected
Projects
None yet
Development

No branches or pull requests

1 participant