From 0ec0d243027f214ae4fc9ea65c01ba096ba065aa Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 26 Oct 2023 20:20:12 -0700 Subject: [PATCH] the goober --- src/zeroes.rs | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/zeroes.rs b/src/zeroes.rs index 30a59b9..8da6954 100644 --- a/src/zeroes.rs +++ b/src/zeroes.rs @@ -2,31 +2,32 @@ use crate::integer::Planar64; #[inline] -pub fn zeroes2(a0:Planar64,a1:Planar64,a2:Planar64)->impl std::iter::IntoIterator{ - // if a2==Planar64::ZERO{ - // return zeroes1(a0,a1); - // } +pub fn zeroes2(a0:Planar64,a1:Planar64,a2:Planar64)->([Planar64;2],usize){ + if a2==Planar64::ZERO{ + let ([ret],ret_len)=zeroes1(a0,a1); + return ([ret,Planar64::ZERO],ret_len); + } let radicand=a1.get() as i128*a1.get() as i128-a2.get() as i128*a0.get() as i128*4; if 0impl std::iter::IntoIterator{ +pub fn zeroes1(a0:Planar64,a1:Planar64)->([Planar64;1],usize){ if a1==Planar64::ZERO{ - return [Planar64::ZERO].into_iter(); + return ([Planar64::ZERO],0); }else{ - return [-a0/a1].into_iter(); + return ([-a0/a1],1); } } \ No newline at end of file