aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/contfrac.spad.pamphlet
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-03-12 17:04:43 +0000
committerdos-reis <gdr@axiomatics.org>2011-03-12 17:04:43 +0000
commit52fddea19454dc2b9bcb54c6edd5a4cd4f5765a9 (patch)
tree4b13ccc6d57c7c1ee615c83615b246c98eae388a /src/algebra/contfrac.spad.pamphlet
parent42d38bee45a64edfc12641053e58581c20584363 (diff)
downloadopen-axiom-52fddea19454dc2b9bcb54c6edd5a4cd4f5765a9.tar.gz
* src/algebra/: Systematically use negative? when comparing for
less than 0.
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]