summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-16 11:23:03 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-16 11:23:03 +0000
commit6be7c95734cd0fea632bf33039c9fa3c0e0ebecc (patch)
treedab73af860cf8791c70c7b3cabbe69f2ff061611
parenta08c5527eab8222d89bfe9c4f410ade5f08b3f7e (diff)
* bignum.c (bigsq): Renamed from bigsqr.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--bignum.c10
2 files changed, 9 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index ef9513c9dd..d65a634afc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Tue Jul 16 20:21:28 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (bigsq): Renamed from bigsqr.
+
Tue Jul 16 19:42:08 2013 Tanaka Akira <akr@fsij.org>
* bignum.c (USHORT): Unused macro removed.
diff --git a/bignum.c b/bignum.c
index 78dd2a8128..47bdf2d1bb 100644
--- a/bignum.c
+++ b/bignum.c
@@ -122,7 +122,7 @@ static VALUE bigmul1_toom3(VALUE x, VALUE y);
static VALUE bignew_1(VALUE klass, long len, int sign);
static inline VALUE bigtrunc(VALUE x);
-static VALUE bigsqr(VALUE x);
+static VALUE bigsq(VALUE x);
static void bigdivmod(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp);
static int
@@ -3371,7 +3371,7 @@ power_cache_get_power0(int base, int i)
if (NIL_P(big2str_power_cache[base - 2][i])) {
big2str_power_cache[base - 2][i] =
i == 0 ? rb_big_pow(rb_int2big(base), INT2FIX(KARATSUBA_DIGITS))
- : bigsqr(power_cache_get_power0(base, i - 1));
+ : bigsq(power_cache_get_power0(base, i - 1));
rb_gc_register_mark_object(big2str_power_cache[base - 2][i]);
}
return big2str_power_cache[base - 2][i];
@@ -3396,7 +3396,7 @@ power_cache_get_power(int base, long n1, long* m1)
j = KARATSUBA_DIGITS*(1 << i);
while (n1 > j) {
- t = bigsqr(t);
+ t = bigsq(t);
j *= 2;
}
return t;
@@ -5357,7 +5357,7 @@ rb_big_fdiv(VALUE x, VALUE y)
}
static VALUE
-bigsqr(VALUE x)
+bigsq(VALUE x)
{
return bigtrunc(bigmul0(x, x));
}
@@ -5417,7 +5417,7 @@ rb_big_pow(VALUE x, VALUE y)
break;
}
for (mask = FIXNUM_MAX + 1; mask; mask >>= 1) {
- if (z) z = bigsqr(z);
+ if (z) z = bigsq(z);
if (yy & mask) {
z = z ? bigtrunc(bigmul0(z, x)) : x;
}