mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
complex.c: undefine clamp
* complex.c (Init_Complex): undefine Complex#clamp, which does not work like other Comparable methods, because Complex does not have <=> method. patched by Tim Peters <zomg.tim AT gmail.com> in [ruby-core:77720]. [Bug #12866] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2639eaebfc
commit
7a9812209d
3 changed files with 9 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
|||
Mon Oct 24 10:19:44 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* complex.c (Init_Complex): undefine Complex#clamp, which does not
|
||||
work like other Comparable methods, because Complex does not
|
||||
have <=> method. patched by Tim Peters <zomg.tim AT gmail.com>
|
||||
in [ruby-core:77720]. [Bug #12866]
|
||||
|
||||
Sun Oct 23 11:41:41 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* include/ruby/encoding.h: include "ruby/ruby.h" explicitly for
|
||||
|
|
|
@ -2234,6 +2234,7 @@ Init_Complex(void)
|
|||
rb_undef_method(rb_cComplex, ">");
|
||||
rb_undef_method(rb_cComplex, ">=");
|
||||
rb_undef_method(rb_cComplex, "between?");
|
||||
rb_undef_method(rb_cComplex, "clamp");
|
||||
rb_undef_method(rb_cComplex, "div");
|
||||
rb_undef_method(rb_cComplex, "divmod");
|
||||
rb_undef_method(rb_cComplex, "floor");
|
||||
|
|
|
@ -755,6 +755,7 @@ class Complex_Test < Test::Unit::TestCase
|
|||
assert_equal(false, c.respond_to?(:>))
|
||||
assert_equal(false, c.respond_to?(:>=))
|
||||
assert_equal(false, c.respond_to?(:between?))
|
||||
assert_equal(false, c.respond_to?(:clamp))
|
||||
assert_equal(false, c.respond_to?(:div))
|
||||
assert_equal(false, c.respond_to?(:divmod))
|
||||
assert_equal(false, c.respond_to?(:floor))
|
||||
|
|
Loading…
Reference in a new issue