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

1/# conversion is wrong when the number is "close" to the next integer #739

Open
Collineli opened this issue Jan 4, 2025 · 1 comment
Open

Comments

@Collineli
Copy link

To be more exact, the conversion seems to fail at exactly (n-1)/n + 1/(2n) to 1/n, for example for n = 2: 1/2 + 1/4 = 0.75, i.e. the exact value that is in-between 1/2 and 1:

> 1/2 + 1/4 - 0.0001 to 1/2
  (1 / 2) + (1 / 4) − 0.0001 ≈ 1/2            (valid)

> 1/2 + 1/4 to 1/2
  (1 / 2) + (1 / 4) ≈ 0                       (invalid)

Also failing at other N values and when there is whole number added:

> 5 + 6/7 + 1/14 -0.0001 to 1/7

  5 + (6 / 7) + (1 / 14) − 0.0001 ≈ 5 + 6/7   (valid)

> 5 + 6/7 + 1/14 to 1/7

  5 + (6 / 7) + (1 / 14) ≈ 5                  (invalid)

qalc version is 5.4.0, all other 1/# conversions seem to work properly.

@hanna-kn
Copy link
Contributor

hanna-kn commented Jan 4, 2025

Fixed.

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

No branches or pull requests

2 participants