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

incorrect rounding of scaled natural numbers in scaled_rounding #1041

Open
dhebbeker opened this issue Mar 2, 2025 · 1 comment
Open

incorrect rounding of scaled natural numbers in scaled_rounding #1041

dhebbeker opened this issue Mar 2, 2025 · 1 comment
Labels

Comments

@dhebbeker
Copy link
Contributor

Some of the scaled rounding functions incorrectly round scaled natural numbers. For example scaled 5.0 is rounded to 6.0 with round_infinity_scaled(). According to the referenced paper in the documentation for round-ceiling (toward positive infinity) this should result to 5.0:

In the source code I see that before division with the scale, SCALING is added (or subtracted) to (or from) the rational parameter value in most rounding functions. Instead the term should be (SCALING - 1). A fix would depend on the intended functionality:

  • either adjust the documentation
  • change the rounding in the source code

Can you please clarify which behaviour is intended? Then somebody could start a pull request...

Based on ETL version 20.40.0.

@jwellbelove
Copy link
Contributor

The functionality should follow the referenced paper.

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

No branches or pull requests

2 participants