1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/ruby
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
..
enc fix UTF-32 valid_encoding? 2017-03-09 02:04:10 +00:00
allpairs.rb
beginmainend.rb
bug-11928.rb
bug-13526.rb test/ruby/bug-13526.rb: should wait until all threads are stopped 2017-11-21 00:56:09 +00:00
lbtest.rb Remove unnecessary require 'thread' 2017-10-08 07:00:01 +00:00
marshaltestlib.rb
sentence.rb
test_alias.rb test/ruby: tweaked heredocs 2017-08-29 07:11:52 +00:00
test_argf.rb io.c: encoding of ARGF.inplace_mode 2017-10-10 12:30:42 +00:00
test_arity.rb
test_array.rb Fixed misspelling words. 2017-10-22 11:27:06 +00:00
test_assignment.rb
test_autoload.rb Remove unnecessary require 'thread' 2017-10-08 07:00:01 +00:00
test_backtrace.rb Remove unnecessary require 'thread' 2017-10-08 07:00:01 +00:00
test_basicinstructions.rb
test_beginendblock.rb test/ruby: tweaked heredocs 2017-08-29 07:11:52 +00:00
test_bignum.rb numeric.c: use NUM2DBL 2017-09-22 03:05:02 +00:00
test_call.rb test_call.rb: refine test_safe_call 2017-10-02 11:43:36 +00:00
test_case.rb
test_class.rb parse.y: no return in class 2017-11-16 05:36:42 +00:00
test_clone.rb
test_comparable.rb
test_complex.rb freeze Complex and Rational 2017-10-19 10:58:08 +00:00
test_complex2.rb
test_complexrational.rb get rid of ambiguous parentheses warnings 2016-11-29 16:06:54 +00:00
test_condition.rb
test_const.rb test for [Feature #11547] 2017-01-01 09:17:10 +00:00
test_continuation.rb
test_defined.rb parse.y: primary should not be 0 2017-08-22 13:21:18 +00:00
test_dir.rb Revert "Dir.glob with FNM_EXTGLOB is optimized [Feature #13873]" 2017-10-27 08:40:40 +00:00
test_dir_m17n.rb High Sierra's APFS cannot use invalid filenames [Bug #13816] 2017-08-15 21:33:43 +00:00
test_econv.rb
test_encoding.rb test/ruby: tweaked heredocs 2017-08-29 07:11:52 +00:00
test_enum.rb range.c: check if exclude_end? is defined 2017-10-25 01:40:15 +00:00
test_enumerator.rb enum.c: check argument first 2017-11-05 23:32:50 +00:00
test_env.rb test_env.rb: fix one-off bug 2017-10-26 07:36:23 +00:00
test_eval.rb test/ruby/test_eval.rb: use orphan procs 2017-11-03 00:52:54 +00:00
test_exception.rb error.c: infinite recursion at Warning#warn 2017-10-13 01:34:52 +00:00
test_fiber.rb make root fiber at switching. 2017-10-26 14:38:22 +00:00
test_file.rb file.c: infect from arguments 2017-11-01 02:22:10 +00:00
test_file_exhaustive.rb file.c: File.lutime 2017-11-29 09:59:20 +00:00
test_fixnum.rb
test_flip.rb test_flip.rb: r56316 2016-11-16 05:25:53 +00:00
test_float.rb numeric.c: fix for small number 2017-05-27 01:26:31 +00:00
test_fnmatch.rb Revert "Dir.glob with FNM_EXTGLOB is optimized [Feature #13873]" 2017-10-27 08:40:40 +00:00
test_gc.rb Revert "Revert "Manage AST NODEs out of GC"" 2017-10-27 16:44:57 +00:00
test_hash.rb Add arity check into Hash#flatten 2017-10-22 00:38:05 +00:00
test_ifunless.rb
test_integer.rb numeric.c: use NUM2DBL 2017-09-22 03:05:02 +00:00
test_integer_comb.rb
test_io.rb disable GC. 2017-11-07 14:23:58 +00:00
test_io_m17n.rb io.c: read BOM only for reading 2017-11-23 07:10:56 +00:00
test_iseq.rb test/ruby/test_iseq.rb: Skip test_safe_call_chain if Coverage is running. 2017-09-25 00:09:44 +00:00
test_iterator.rb check break target correctly. 2017-06-08 04:13:51 +00:00
test_keyword.rb compile.c: kw splat after splat 2017-11-02 07:52:49 +00:00
test_lambda.rb vm_args.c: arity check of lambda 2017-03-19 01:11:12 +00:00
test_lazy_enumerator.rb enum.c: check argument first 2017-11-05 23:32:50 +00:00
test_literal.rb compile.c: fixup r60727 2017-11-13 23:53:00 +00:00
test_m17n.rb refine a warning message. 2017-03-02 23:33:06 +00:00
test_m17n_comb.rb
test_marshal.rb Rename RbConfig::Limits as RbConfig::LIMITS 2017-04-06 02:10:40 +00:00
test_math.rb
test_metaclass.rb
test_method.rb fix backtrace on argment error. 2017-11-09 05:22:51 +00:00
test_mixed_unicode_escapes.rb
test_module.rb Make Module#{define|alias|undef|remove}_method public [#14133] 2017-11-29 17:47:59 +00:00
test_not.rb
test_notimp.rb apply timeout scale 2017-05-27 02:01:41 +00:00
test_numeric.rb bignum.c, numeric.c: add Integer#pow(b, m) 2017-12-04 02:35:40 +00:00
test_object.rb object.c: fix conversion failure message 2017-09-15 02:01:59 +00:00
test_objectspace.rb
test_optimization.rb fix uninitialized memory reference. 2017-11-15 04:52:39 +00:00
test_pack.rb pack.c: unpack "M" may be ASCII only 2017-09-29 08:00:47 +00:00
test_parse.rb parse.y: zero codepoints 2017-11-14 15:37:48 +00:00
test_path.rb
test_pipe.rb
test_primitive.rb
test_proc.rb * proc.c (get_local_variable_ptr): return found env ptr. Returned env 2017-06-12 02:20:09 +00:00
test_process.rb process.c: null byte at initgroups 2017-10-11 06:16:03 +00:00
test_rand.rb random.c: ensure initialized 2017-07-19 03:16:58 +00:00
test_range.rb range.c: use rb_check_funcall 2017-10-25 05:23:54 +00:00
test_rational.rb freeze Complex and Rational 2017-10-19 10:58:08 +00:00
test_rational2.rb
test_readpartial.rb
test_refinement.rb Modules should not have subclasses. 2017-12-02 10:54:39 +00:00
test_regexp.rb regexec.c: invalidate previously matched position 2017-11-13 05:50:54 +00:00
test_require.rb load.c: real path to load 2017-09-21 07:29:20 +00:00
test_rubyoptions.rb load.c: cwd encoding 2017-11-12 04:45:51 +00:00
test_rubyvm.rb
test_settracefunc.rb remove rb_thread_t::event_hooks. 2017-11-15 13:21:24 +00:00
test_signal.rb remove ruby_kill() introduced for [Bug #7951]. 2017-06-12 04:52:25 +00:00
test_sleep.rb
test_sprintf.rb error.c: KeyError#receiver and KeyError#key 2017-09-18 08:05:53 +00:00
test_sprintf_comb.rb
test_string.rb Fix a target method of a test 2017-10-22 07:04:00 +00:00
test_stringchar.rb
test_struct.rb * test/ruby/test_module.rb: Method tables are not guaranteed to be 2016-11-14 19:27:24 +00:00
test_super.rb
test_symbol.rb Suppress warning: method redefined; discarding old == 2017-07-03 08:08:29 +00:00
test_syntax.rb parse.y: no return in class 2017-11-16 05:36:42 +00:00
test_system.rb
test_thread.rb Remove unnecessary require 'thread' 2017-10-08 07:00:01 +00:00
test_threadgroup.rb Remove unnecessary require 'thread' 2017-10-08 07:00:01 +00:00
test_time.rb Time#at receives 3rd argument which specifies the unit of 2nd argument [Feature #13919] 2017-09-25 06:20:10 +00:00
test_time_tz.rb
test_trace.rb test_exception.rb: test_machine_stackoverflow_by_trace 2017-05-10 06:38:30 +00:00
test_transcode.rb Fix typo in comment 2017-10-21 23:32:57 +00:00
test_undef.rb
test_unicode_escape.rb parse.y: relax spaces 2016-12-02 02:47:11 +00:00
test_variable.rb Fix typos 2016-12-06 12:49:46 +00:00
test_vm_dump.rb skip unless PLATFORM is darwin. 2017-09-01 02:09:02 +00:00
test_weakmap.rb skip tests temporarily 2017-10-27 18:55:28 +00:00
test_whileuntil.rb
test_yield.rb vm_args.c: arity check of lambda 2017-03-19 01:11:12 +00:00
ut_eof.rb