aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/numtheor.spad.pamphlet
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-03-12 22:56:37 +0000
committerdos-reis <gdr@axiomatics.org>2011-03-12 22:56:37 +0000
commit6c75a87d8ee00d48a0f5703aa9c86591078a50d3 (patch)
tree28ff587bbc4d759dd0e3f96b156700ff01ba8c53 /src/algebra/numtheor.spad.pamphlet
parenta2e3e641bdbcb6e77bbb572aea25a748a967abca (diff)
downloadopen-axiom-6c75a87d8ee00d48a0f5703aa9c86591078a50d3.tar.gz
* src/algebra/: Systematically use not one? when comparing for
equality with 1.
Diffstat (limited to 'src/algebra/numtheor.spad.pamphlet')
-rw-r--r--src/algebra/numtheor.spad.pamphlet10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/algebra/numtheor.spad.pamphlet b/src/algebra/numtheor.spad.pamphlet
index 98a30591..0e40d82e 100644
--- a/src/algebra/numtheor.spad.pamphlet
+++ b/src/algebra/numtheor.spad.pamphlet
@@ -131,7 +131,7 @@ Using the half extended Euclidean algorithm we compute 1/a mod b.
r:I := a-q*b
(a,b):=(b,r)
(c1,d1):=(d1,c1-q*d1)
- a ~= 1 => error("moduli are not relatively prime")
+ not one? a => error("moduli are not relatively prime")
positiveRemainder(c1,borg)
@
@@ -155,11 +155,11 @@ inverse(a,b) ==
print [a, "=", q, "*(", b, ")+", r]
(a,b):=(b,r)
(c1,d1):=(d1,c1-q*d1)
- a ~= 1 => error("moduli are not relatively prime")
+ not one? a => error("moduli are not relatively prime")
positiveRemainder(c1,borg)
-if ((inverse(26,15)*26)::IntegerMod(15) ~= 1) then print "DALY BUG"
-if ((inverse(15,26)*15)::IntegerMod(26) ~= 1) then print "DALY BUG"
+if not one?((inverse(26,15)*26)::IntegerMod(15)) then print "DALY BUG"
+if not one?((inverse(15,26)*15)::IntegerMod(26)) then print "DALY BUG"
@
\subsection{The Chinese Remainder Algorithm}
@@ -566,7 +566,7 @@ PolynomialNumberTheoryFunctions(): Exports == Implementation where
MonicQuotient: (SUP(I),SUP(I)) -> SUP(I)
MonicQuotient (a,b) ==
- leadingCoefficient(b) ~= 1 => error "divisor must be monic"
+ not one? leadingCoefficient(b) => error "divisor must be monic"
b = 1 => a
da := degree a
db := degree b -- assertion: degree b > 0