You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are many places where we protect against zero denominator when constructing a rational that has a property x % 0 == 0. We should create a helper function %? that takes care of this use case for us and use it in all places where this use case occurs.
The text was updated successfully, but these errors were encountered:
I started on this, but I think it'd be better to add a new type NonZeroRational which can only be constructed from a non-zero rational. Then %? can have the type Rational -> NonZeroRational -> Rational.
The reason that I think this'll be better is that we often divide by totalStake so if we changed the type of totalStake to NonZeroRational, we'd only have to prove that it's non-zero once and then we can divide by that however many times we want.
There are many places where we protect against zero denominator when constructing a rational that has a property
x % 0 == 0
. We should create a helper function%?
that takes care of this use case for us and use it in all places where this use case occurs.The text was updated successfully, but these errors were encountered: