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

Fix round for float value when input out of long range #23765

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hantangwangd
Copy link
Member

@hantangwangd hantangwangd commented Oct 3, 2024

Description

Fixes #23763

Motivation and Context

Fix issue: #23763

Impact

N/A

Test Plan

Contributor checklist

  • Please make sure your submission complies with our development, formatting, commit message, and attribution guidelines.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

== NO RELEASE NOTE ==

Copy link
Contributor

@elharo elharo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix!

@@ -814,6 +814,9 @@ public void testRound()
assertFunction("round(REAL '90000000.0', 1000)", REAL, 90000000.0f);
assertFunction("round(REAL '300000000.0', 100)", REAL, 300000000.0f);
assertFunction("round(REAL '-300000000.0', 100)", REAL, -300000000.0f);
assertFunction("round(REAL '1.0E19', 1)", REAL, 1.0E19f);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should probably go in a new test method with a comment linking to the bug so they can pass or fail independently

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion, fixed! Please take a look when available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Round function returns incorrect results for large floats
2 participants