1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* complex.c (nucomp_rationalize): fix function. [ruby-core:40667]

[Bug #5546]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2011-11-02 12:36:06 +00:00
parent c852d76f46
commit 292b3e4113
3 changed files with 7 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Wed Nov 2 21:36:00 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* complex.c (nucomp_rationalize): fix function. [ruby-core:40667]
[Bug #5546]
Wed Nov 2 08:16:45 2011 Tanaka Akira <akr@fsij.org>
* lib/webrick/utils.rb: fix fcntl call.

View file

@ -1374,7 +1374,7 @@ nucomp_rationalize(int argc, VALUE *argv, VALUE self)
rb_raise(rb_eRangeError, "can't convert %s into Rational",
StringValuePtr(s));
}
return rb_funcall(dat->real, rb_intern("rationalize"), argc, argv);
return rb_funcall2(dat->real, rb_intern("rationalize"), argc, argv);
}
/*

View file

@ -16,6 +16,7 @@ class Complex_Test < Test::Unit::TestCase
def test_rationalize
assert_equal(1.quo(3), Complex(1/3.0, 0).rationalize, '[ruby-core:38885]')
assert_equal(1.quo(5), Complex(0.2, 0).rationalize, '[ruby-core:38885]')
assert_equal(5.quo(2), Complex(2.5, 0).rationalize(0), '[ruby-core:40667]')
end
def test_compsub