Skip to content

fix: use rao instead of tao in Balance.__floordiv__ for consistency#922

Open
Grizouforever wants to merge 5 commits intolatent-to:stagingfrom
Grizouforever:fix/balance-floordiv-rao
Open

fix: use rao instead of tao in Balance.__floordiv__ for consistency#922
Grizouforever wants to merge 5 commits intolatent-to:stagingfrom
Grizouforever:fix/balance-floordiv-rao

Conversation

@Grizouforever
Copy link
Copy Markdown

Summary

Balance.__floordiv__ uses self.tao // other.tao (float values) while every other arithmetic operator consistently uses .rao (integer):

Operator Implementation
__add__ self.rao + other.rao
__sub__ self.rao - other.rao
__mul__ self.rao * other.rao
__truediv__ self.rao / other.rao
__rfloordiv__ other / self.rao
__floordiv__ self.tao // other.tao

Changes

Change self.tao // other.tao to self.rao // other.rao in balances.py line 214 to match the pattern used by all sibling operators.

ibraheem-abe and others added 4 commits March 19, 2026 17:04
Balance.__floordiv__ uses self.tao // other.tao while every other
arithmetic operator (__add__, __sub__, __mul__, __truediv__,
__rfloordiv__) consistently uses .rao. This inconsistency produces
incorrect results when dividing two Balance objects.

Change to self.rao // other.rao to match the pattern used by all
other operators.
@thewhaleking thewhaleking changed the base branch from main to staging April 13, 2026 18:57
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.

3 participants