forked from StrafesNET/strafe-client
overflow detect
This commit is contained in:
parent
9bfcf0b083
commit
49e077996d
@ -29,6 +29,11 @@ pub fn zeroes1(a0:Planar64,a1:Planar64) -> Vec<Planar64> {
|
||||
if a1==Planar64::ZERO{
|
||||
return vec![];
|
||||
}else{
|
||||
return vec![-a0/a1];
|
||||
let q=((-a0.get() as i128)<<32)/(a1.get() as i128);
|
||||
if i64::MIN as i128<=q&&q<=i64::MAX as i128{
|
||||
return vec![Planar64::raw(q as i64)];
|
||||
}else{
|
||||
return vec![];
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user