aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/si.spad.pamphlet
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-03-12 20:44:33 +0000
committerdos-reis <gdr@axiomatics.org>2011-03-12 20:44:33 +0000
commita2e3e641bdbcb6e77bbb572aea25a748a967abca (patch)
tree812a69aecaa223a4416ad0d0dede9d5440d5d950 /src/algebra/si.spad.pamphlet
parentc93e84048964194e5674e859d6bd8827010f09f6 (diff)
downloadopen-axiom-a2e3e641bdbcb6e77bbb572aea25a748a967abca.tar.gz
* src/algebra/: Systematically use negative? when comparing for
equality with 0.
Diffstat (limited to 'src/algebra/si.spad.pamphlet')
-rw-r--r--src/algebra/si.spad.pamphlet10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/algebra/si.spad.pamphlet b/src/algebra/si.spad.pamphlet
index 888a40f3..f8296439 100644
--- a/src/algebra/si.spad.pamphlet
+++ b/src/algebra/si.spad.pamphlet
@@ -226,6 +226,7 @@ SingleInteger(): Join(IntegerNumberSystem,OrderedFinite,BooleanLogic,OpenMath) w
import %hash: % -> SingleInteger from Foreign Builtin
import %ilength: % -> % from Foreign Builtin
import %iodd?: % -> Boolean from Foreign Builtin
+ import %ieven?: % -> Boolean from Foreign Builtin
import %ieq: (%,%) -> Boolean from Foreign Builtin
import %ilt: (%,%) -> Boolean from Foreign Builtin
import %ile: (%,%) -> Boolean from Foreign Builtin
@@ -319,6 +320,7 @@ SingleInteger(): Join(IntegerNumberSystem,OrderedFinite,BooleanLogic,OpenMath) w
gcd(x,y) == %igcd(x,y)
abs(x) == %iabs x
odd?(x) == %iodd? x
+ even?(x) == %ieven? x
zero?(x) == %ieq(x,%icst0)
one?(x) == %ieq(x,%icst1)
max(x,y) == %imax(x,y)
@@ -334,7 +336,7 @@ SingleInteger(): Join(IntegerNumberSystem,OrderedFinite,BooleanLogic,OpenMath) w
(%icstmax - %icstmin + %icst1) pretend NonNegativeInteger
index i == per(i + rep %icstmin - rep %icst1)
lookup x ==
- (x - %icstmin + %icst1) pretend PositiveInteger
+ (rep x - rep %icstmin + rep %icst1) pretend PositiveInteger
reducedSystem(m: Matrix %, v: Vector %) ==
@@ -353,9 +355,9 @@ SingleInteger(): Join(IntegerNumberSystem,OrderedFinite,BooleanLogic,OpenMath) w
UCA ==> Record(unit:%,canonical:%,associate:%)
unitNormal x ==
- negative? x => [-1@%,-x,-1@%]$UCA
- [1@%,x,1@%]$UCA
- positive? x == 0 < x
+ negative? x => [-%icst1,-x,-%icst1]$UCA
+ [%icst1,x,%icst1]$UCA
+ positive? x == %icst0 < x
@