overflow detect

This commit is contained in:
Quaternions 2023-12-02 01:24:52 -08:00
parent 9bfcf0b083
commit 49e077996d

View File

@ -29,6 +29,11 @@ pub fn zeroes1(a0:Planar64,a1:Planar64) -> Vec<Planar64> {
if a1==Planar64::ZERO{ if a1==Planar64::ZERO{
return vec![]; return vec![];
}else{ }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![];
}
} }
} }