summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authorYukihiro Matsumoto <matz@ruby-lang.org>1997-10-21 13:31:29 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2019-08-17 22:09:33 +0900
commit9b01ce69546380c57cb602e045be4fc012cd81b7 (patch)
treee6580f3b54cf894cbd9226a573f315965fe8d164 /bignum.c
parent2a4ba10e2d68c09ddb2e3f5751f5161c00a13bf5 (diff)
version 1.0-971021v1_0_971021
https://cache.ruby-lang.org/pub/ruby/1.0/ruby-1.0-971021.tar.gz Tue Oct 21 13:31:29 1997 Yukihiro Matsumoto <matz@netlab.co.jp> * version 1.0-971021 Mon Oct 20 12:18:29 1997 WATANABE Hirofumi <watanabe@ase.ptg.sony.co.jp> * ruby.c (load_file): wrong condition for #! check with -x. * file.c (file_s_dirname): did return "" for "/a". Fri Oct 17 14:29:09 1997 Yukihiro Matsumoto <matz@netlab.co.jp> * bignum.c (bigadd): some undefined side effect order assumed. Co-authored-by: WATANABE Hirofumi <watanabe@ase.ptg.sony.co.jp>
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/bignum.c b/bignum.c
index 8af40d6731..4bdcb6b63a 100644
--- a/bignum.c
+++ b/bignum.c
@@ -101,6 +101,13 @@ bignorm(x)
}
VALUE
+big_norm(x)
+ VALUE x;
+{
+ return bignorm(x);
+}
+
+VALUE
uint2big(n)
UINT n;
{
@@ -514,7 +521,8 @@ bigsub(x, y)
num = BIGDN(num);
}
while (i < x->len) {
- zds[i++] = BDIGITS(x)[i];
+ zds[i] = BDIGITS(x)[i];
+ i++;
}
return bignorm(z);
@@ -555,7 +563,8 @@ bigadd(x, y, sign)
num = BIGDN(num);
}
while (i < y->len) {
- BDIGITS(z)[i++] = BDIGITS(y)[i];
+ BDIGITS(z)[i] = BDIGITS(y)[i];
+ i++;
}
BDIGITS(z)[i] = num;