-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Closed
Description
- Possible-machine integers are treated as mathematical integers:
Ratio::reduce, where the unary minus operator on a negative number is assumed to yield a positive number. self.denomis compared toZero::zeroinstead of callingis_zero().Ratio::recipmight return a fractions with a denominator of0.
There are also some issues regarding overflows, it seems the module just hopes that they won't happen at all – except for wrong results, this could also raise a fail!()ure, when e.g. 1/sqrt(max_int) is multiplied with itself, yielding 1/0.
This might mean that Rust needs some general guideline on how to treat integer overflow.
Metadata
Metadata
Assignees
Labels
No labels