diff options
author | Gabriel Dos Reis <gdr@axiomatics.org> | 2015-12-31 13:29:37 -0800 |
---|---|---|
committer | Gabriel Dos Reis <gdr@axiomatics.org> | 2015-12-31 13:29:37 -0800 |
commit | 039d244dbef31e4ca6d34d2cf42b58b41a572884 (patch) | |
tree | a8682ba2deba76a923969a9c92f8f4441703832b /src/algebra/integer.spad.pamphlet | |
parent | 3fe5ede20d325254817e50d735e9e09c0c875860 (diff) | |
download | open-axiom-039d244dbef31e4ca6d34d2cf42b58b41a572884.tar.gz |
Improve 'random()' from Integer domain.
Diffstat (limited to 'src/algebra/integer.spad.pamphlet')
-rw-r--r-- | src/algebra/integer.spad.pamphlet | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/algebra/integer.spad.pamphlet b/src/algebra/integer.spad.pamphlet index 789695d6..6838a053 100644 --- a/src/algebra/integer.spad.pamphlet +++ b/src/algebra/integer.spad.pamphlet @@ -81,6 +81,8 @@ Integer: IntegerNumberSystem with import %icst1: % from Foreign Builtin import %ineg: % -> % from Foreign Builtin import %iabs: % -> % from Foreign Builtin + import %iinc: % -> % from Foreign Builtin + import %idec: % -> % from Foreign Builtin import %irandom: % -> % from Foreign Builtin import %iodd?: % -> Boolean from Foreign Builtin import %ieven?: % -> Boolean from Foreign Builtin @@ -103,17 +105,18 @@ Integer: IntegerNumberSystem with import %igt: (%,%) -> Boolean from Foreign Builtin import %ige: (%,%) -> Boolean from Foreign Builtin import %ilength: % -> % from Foreign Builtin + import %ibigrandom: () -> % from Foreign Builtin import %i2s: % -> String from Foreign Builtin import %strconc: (String,String) -> String from Foreign Builtin - zero? x == x = 0$% - one? x == x = 1$% 0 == %icst0 1 == %icst1 + zero? x == x = 0$% + one? x == x = 1$% base() == 2 pretend % copy x == x - inc x == x + 1$% - dec x == x - 1$% + inc x == %iinc x + dec x == %idec x hash x == %hash x negative? x == x < 0$% positive? x == 0$% < x @@ -147,7 +150,7 @@ Integer: IntegerNumberSystem with [m pretend Matrix(Integer), v pretend Vector(Integer)] abs(x) == %iabs x - random() == random()$Lisp + random() == %ibigrandom() random(x) == %irandom x x = y == %ieq(x,y) x < y == %ilt(x,y) |