mrkn 9b09cc8a37 bignum.c, numeric.c: add Integer#pow(b, m)
This commit is based on the pull-request #1320 created by Makoto Kishimoto.
[Feature #12508] [Feature #11003] [close GH-1320]

* bignum.c (rb_int_powm): Added for Integer#pow(b, m).

* internal.h (rb_int_powm): Declared to refer in numeric.c.

* bignum.c (bary_powm_gmp): Added for Integer#pow(b, m) using GMP.

* bignum.c (int_pow_tmp1): Added for implementing Integer#pow(b, m).

* bignum.c (int_pow_tmp2, int_pow_tmp3): ditto.

* internal.h (rb_num_positive_int_p): Moved from numeric.c for sharing
  the definition with bignum.c.

* internal.h (rb_num_negative_int_p, rb_num_compare_with_zero): ditto.

* numeric.c(negative_int_p): Moved to internal.h for sharing the
  definition with bignum.c.

* numeric.c (positive_int_p, compare_with_zero): ditto.

* numeric.c (rb_int_odd_p): Exported (renamed from int_odd_p).

* internal.h (rb_int_odd_p): ditto.

* internal.h (HALF_LONG_MSB): Added.

* numeric.c (SQRT_LONG_MAX): Redefined by using HALF_LONG_MSB.

* test/ruby/test_numeric.rb (test_pow): Added for Integer#pow(b, m).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-04 02:35:40 +00:00
..
2017-12-03 12:06:16 +00:00
2017-05-18 15:13:30 +00:00
2017-10-21 14:22:04 +00:00
2017-09-15 17:42:00 +00:00
2017-11-21 05:01:28 +00:00
2017-10-21 14:35:19 +00:00
2017-09-28 02:51:41 +00:00
2017-11-29 11:27:32 +00:00
2017-06-16 04:04:53 +00:00
2017-11-27 02:11:36 +00:00
2017-12-04 00:23:31 +00:00
2017-10-23 14:05:07 +00:00
2017-09-15 16:56:16 +00:00
2017-11-26 10:33:32 +00:00
2017-10-23 14:05:07 +00:00
2017-10-22 11:27:06 +00:00
2017-12-01 01:52:26 +00:00
2017-03-14 15:14:21 +00:00
2017-11-24 04:26:27 +00:00
2017-11-28 22:30:28 +00:00
2017-10-21 12:34:13 +00:00
2017-10-23 07:06:12 +00:00
2017-10-21 13:34:19 +00:00
2017-10-22 12:25:34 +00:00