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

bitHammingDistance is wrong for big integer data types. #57059

Closed
alexey-milovidov opened this issue Nov 21, 2023 · 0 comments · Fixed by #57073
Closed

bitHammingDistance is wrong for big integer data types. #57059

alexey-milovidov opened this issue Nov 21, 2023 · 0 comments · Fixed by #57073
Assignees
Labels
bug Confirmed user-visible misbehaviour in official release

Comments

@alexey-milovidov
Copy link
Member

milovidov-desktop :) SELECT 314776434768051644139306697240981192872::UInt128 AS x, 0::UInt128 AS y, bitCount(bitXor(x, y)) AS a, bitHammingDistance(x, y) AS b

SELECT
    CAST('314776434768051644139306697240981192872', 'UInt128') AS x,
    CAST('0', 'UInt128') AS y,
    bitCount(bitXor(x, y)) AS a,
    bitHammingDistance(x, y) AS b

Query id: b7b00e85-2c4e-428c-8698-e15eea5fae15

┌───────────────────────────────────────x─┬─y─┬──a─┬──b─┐
│ 314776434768051644139306697240981192872 │ 0 │ 74 │ 32 │
└─────────────────────────────────────────┴───┴────┴────┘

1 row in set. Elapsed: 0.001 sec.
@alexey-milovidov alexey-milovidov added the bug Confirmed user-visible misbehaviour in official release label Nov 21, 2023
@alexey-milovidov alexey-milovidov changed the title bitHammingDistance is wrong. bitHammingDistance is wrong for big integer data types. Nov 21, 2023
@alexey-milovidov alexey-milovidov self-assigned this Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed user-visible misbehaviour in official release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant