aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/contfrac.spad.pamphlet
diff options
context:
space:
mode:
Diffstat (limited to 'src/algebra/contfrac.spad.pamphlet')
-rw-r--r--src/algebra/contfrac.spad.pamphlet6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/algebra/contfrac.spad.pamphlet b/src/algebra/contfrac.spad.pamphlet
index e7291148..c1adc3ea 100644
--- a/src/algebra/contfrac.spad.pamphlet
+++ b/src/algebra/contfrac.spad.pamphlet
@@ -161,7 +161,7 @@ ContinuedFraction(R): Exports == Implementation where
d := denom a
q := n quo d
r := n - q*d
- if r < 0 then q := q - 1
+ if negative? r then q := q - 1
q
eucWhole a
@@ -187,8 +187,8 @@ ContinuedFraction(R): Exports == Implementation where
empty? nums or empty? dens => empty()
n := frst nums
d := frst dens
- n < 0 => error "Numerators must be greater than 0."
- d < 0 => error "Denominators must be greater than 0."
+ negative? n => error "Numerators must be greater than 0."
+ negative? d => error "Denominators must be greater than 0."
concat([n,d]$Rec, delay genFractionA(rst nums,rst dens))
else
continuedFraction(wh,nums,dens) == [[wh,genFractionB(nums,dens)],false]