aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/defaults.spad.pamphlet
diff options
context:
space:
mode:
Diffstat (limited to 'src/algebra/defaults.spad.pamphlet')
-rw-r--r--src/algebra/defaults.spad.pamphlet8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/algebra/defaults.spad.pamphlet b/src/algebra/defaults.spad.pamphlet
index 490ae98a..5f9ca825 100644
--- a/src/algebra/defaults.spad.pamphlet
+++ b/src/algebra/defaults.spad.pamphlet
@@ -19,14 +19,12 @@
RepeatedSquaring(S): Exports == Implementation where
S: SetCategory with
- "*":(%,%)->%
+ *: (%,%)->%
++ x*y returns the product of x and y
Exports == with
expt: (S,PositiveInteger) -> S
++ expt(r, i) computes r**i by repeated squaring
Implementation == add
- x: S
- n: PositiveInteger
expt(x, n) ==
one? n => x
odd?(n)$Integer=> x * expt(x*x,shift(n,-1) pretend PositiveInteger)
@@ -44,14 +42,12 @@ RepeatedSquaring(S): Exports == Implementation where
RepeatedDoubling(S):Exports ==Implementation where
S: SetCategory with
- "+":(%,%)->%
+ +: (%,%)->%
++ x+y returns the sum of x and y
Exports == with
double: (PositiveInteger,S) -> S
++ double(i, r) multiplies r by i using repeated doubling.
Implementation == add
- x: S
- n: PositiveInteger
double(n,x) ==
one? n => x
odd?(n)$Integer =>