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

floating point arithmetic related errors #41

Open
CKnoppe opened this issue Dec 8, 2021 · 0 comments
Open

floating point arithmetic related errors #41

CKnoppe opened this issue Dec 8, 2021 · 0 comments

Comments

@CKnoppe
Copy link

CKnoppe commented Dec 8, 2021

Not sure if this is still an open project that you are willing to put more work into, but if yes:

Due to the naturally imprecise representation of decimals in binary (e.g. 0.1 + 0.1 + 0.1 == 0.3 yields False), emptying an account does not always leave the account balanced. That is, if you have amount x on account A of a ledger, and you withdraw amount x, the balance is not always (BALANCED, 0) and even throws an assertion error in the booking operation, if the AccounSide ends on the wrong side. An option would be to use Decimal types from the decimals module.

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