diff options
| author | azidar | 2015-07-30 16:00:40 -0700 |
|---|---|---|
| committer | azidar | 2015-07-30 16:00:40 -0700 |
| commit | 4264d0c18948905ef0d924002ca828b19a69e69b (patch) | |
| tree | f9a338aecda2d0717c1acced66b5aa0816171694 /src/main/stanza/bigint.stanza | |
| parent | a2f3ac70d45b6a419178e2d28a2b7be801599d13 (diff) | |
Updated error and feature tests. Fixed bug in detecting incorrect genders
Diffstat (limited to 'src/main/stanza/bigint.stanza')
| -rw-r--r-- | src/main/stanza/bigint.stanza | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/stanza/bigint.stanza b/src/main/stanza/bigint.stanza index c2a3437a..ad4a5bde 100644 --- a/src/main/stanza/bigint.stanza +++ b/src/main/stanza/bigint.stanza @@ -239,6 +239,12 @@ public defn neg! (d: BigInt, s0: BigInt) -> BigInt : public defn neg (x:BigInt) -> BigInt : op(neg!, x) +public defn neg? (x:BigInt) -> True|False : + val nw = num-words(x) + val msb = x[nw - 1] >> (length(x) - nw * 32 - 1) + if msb == 0 : false + else : true + public defn rsha! (d:BigInt, s0:BigInt, amount:Int) -> BigInt : val w = length(s0) val nw = num-words(d) |
