From c31f6285c71ec0ad8052205d7029986453c465ce Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 7 Mar 2018 12:04:43 +0000 Subject: complex.c: check type * complex.c (m_cos, m_sin): determine the type by the internal type, not by a method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- complex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'complex.c') diff --git a/complex.c b/complex.c index 6b54d44ba2..43f2964545 100644 --- a/complex.c +++ b/complex.c @@ -486,7 +486,7 @@ imp1(sinh) static VALUE m_cos(VALUE x) { - if (f_real_p(x)) + if (!RB_TYPE_P(x, T_COMPLEX)) return m_cos_bang(x); { get_dat1(x); @@ -501,7 +501,7 @@ m_cos(VALUE x) static VALUE m_sin(VALUE x) { - if (f_real_p(x)) + if (!RB_TYPE_P(x, T_COMPLEX)) return m_sin_bang(x); { get_dat1(x); -- cgit v1.2.3