mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 13:27:57 +00:00
We should panic on division by zero (#5844)
This commit is contained in:
@@ -167,8 +167,7 @@ impl ops::Div for Fixed64 {
|
||||
|
||||
fn div(self, rhs: Self) -> Self::Output {
|
||||
if rhs.0 == 0 {
|
||||
let zero = 0;
|
||||
return Fixed64::from_parts( self.0 / zero);
|
||||
panic!("attempt to divide by zero");
|
||||
}
|
||||
let (n, d) = if rhs.0 < 0 {
|
||||
(-self.0, rhs.0.abs() as u64)
|
||||
|
||||
Reference in New Issue
Block a user