bits don't conflict

This commit is contained in:
Quaternions 2024-08-29 16:37:04 -07:00
parent e38126302e
commit b11a060042

View File

@ -459,7 +459,7 @@ impl Planar64{
let mut result=Self::raw(1<<pow); let mut result=Self::raw(1<<pow);
let wide_self=(self.0 as i128)<<FRAC; let wide_self=(self.0 as i128)<<FRAC;
for i in (0..=pow).rev(){ for i in (0..=pow).rev(){
let new_result=result+Self::raw(1<<i); let new_result=Self::raw(result.0|1<<i);
match wide_self.cmp(&((new_result.0 as i128)*(new_result.0 as i128))){ match wide_self.cmp(&((new_result.0 as i128)*(new_result.0 as i128))){
core::cmp::Ordering::Less=>(), core::cmp::Ordering::Less=>(),
core::cmp::Ordering::Equal=>return new_result, core::cmp::Ordering::Equal=>return new_result,