diff options
Diffstat (limited to 'src/algebra/padic.spad.pamphlet')
-rw-r--r-- | src/algebra/padic.spad.pamphlet | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/algebra/padic.spad.pamphlet b/src/algebra/padic.spad.pamphlet index 6b3481d1..47c53e8a 100644 --- a/src/algebra/padic.spad.pamphlet +++ b/src/algebra/padic.spad.pamphlet @@ -293,7 +293,7 @@ InnerPAdicInteger(p,unBalanced?): Exports == Implementation where count : NNI := _$streamCount$Lisp l : L OUT := empty() n : NNI := 0 - while n <= count while not empty? st repeat + while n <= count and not empty? st repeat if frst(st) ~= 0 then l := concat(termOutput(n :: I,frst st),l) st := rst st @@ -516,17 +516,21 @@ PAdicRationalConstructor(p,PADIC): Exports == Implementation where uu := digits zp l : L OUT := empty() empty? uu => 0 :: OUT - n : NNI ; count : NNI := _$streamCount$Lisp - for n in 0..count while not empty? uu repeat + count : NNI := _$streamCount$Lisp + n : NNI := 0 + while n <= count and not empty? uu repeat if frst(uu) ~= 0 then l := concat(termOutput((n :: I) + m,frst(uu)),l) uu := rst uu + n := n + 1 if showAll?() then - for n in (count + 1).. while explicitEntries? uu and _ + n := count + 1 + while explicitEntries? uu and _ not eq?(uu,rst uu) repeat if frst(uu) ~= 0 then l := concat(termOutput((n::I) + m,frst(uu)),l) uu := rst uu + n := n + 1 l := explicitlyEmpty? uu => l eq?(uu,rst uu) and frst uu = 0 => l |