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

bug: numeric functions combine result is not right #14189

Closed
BohuTANG opened this issue Dec 30, 2023 · 1 comment · Fixed by #14195
Closed

bug: numeric functions combine result is not right #14189

BohuTANG opened this issue Dec 30, 2023 · 1 comment · Fixed by #14195
Labels
C-bug Category: something isn't working found-by-GPT4

Comments

@BohuTANG
Copy link
Member

BohuTANG commented Dec 30, 2023

Summary

SELECT 
    (POW(FLOOR(ABS(9876.54321) * 10000), 2) % 18446744073709551615) + 
    (FLOOR(EXP(SQRT(1234.56789)) * 10000) % 18446744073709551615) - 
    (FLOOR(PI() * 10000) % 18446744073709551615) AS uint64_like_result;

Databend:1.8188020807335311e19
MySQL: 1.8188025698028737e19
Snowflake: 1.81880256980287e+19
DuckDB: 18188025698028737000

@BohuTANG BohuTANG added C-bug Category: something isn't working found-by-GPT4 labels Dec 30, 2023
@sundy-li
Copy link
Member

sundy-li commented Jan 2, 2024

Snowflake will drop precisions for unknown reasons. I think duckdb & MySQL handle it better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: something isn't working found-by-GPT4
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants