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

If the difference is negative, numbers round improperly #31

Open
AngelTomkins opened this issue Feb 18, 2021 · 0 comments
Open

If the difference is negative, numbers round improperly #31

AngelTomkins opened this issue Feb 18, 2021 · 0 comments

Comments

@AngelTomkins
Copy link

Expected Behavior

Subtracting decimals should round properly. Eg,

0.2 - 0.3 = -0.1

Current Behavior

When subtracting decimals, if the subtrahend is larger than the minuend, the difference will be rounded improperly.

0.2 - 0.3 = -0.09999999999999998

Weirdly enough it works properly with the tenth less in both the minuend and the subtrahend: 0.1 - 0.2 = -0.1

Possible Solution

Probably just the mathfloor/mathceiling

Steps to Reproduce (for bugs only)

See above

Context

The calculator gives an incorrect difference, which is important for accuracy

Environment

Tested on both Arch Linux desktop and Arch Linux Arm on Pinephone

  • Version used: 1.3.0-1
  • Operating system and version: Arch Linux and Arch Linux Arm
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

1 participant