lol idk #1

Open
Quaternions wants to merge 826 commits from StrafesNET/strafe-project:master into master
Showing only changes of commit c856509759 - Show all commits

View File

@ -17,10 +17,7 @@ macro_rules! impl_zeroes{
let radicand=a1.[<wide_mul_ $n _ $n>](a1)-a2.[<wide_mul_ $n _ $n>](a0)*4;
match radicand.cmp(&Fixed::<{$n*2},{$n*2*32}>::ZERO){
Ordering::Greater=>{
//start with f64 sqrt
//failure case: 2^63 < sqrt(2^127)
let planar_radicand=radicand.sqrt().halve_precision();
//TODO: one or two newtons
//sort roots ascending and avoid taking the difference of large numbers
match (a2pos,Self::ZERO<a1){
(true, true )=>[Ratio::new(-a1-planar_radicand,a2*2),Ratio::new(a0*2,-a1-planar_radicand)].into(),