From b53d547f38894962f299442219c2ed5814e63715 Mon Sep 17 00:00:00 2001 From: usa Date: Fri, 22 May 2015 11:57:43 +0000 Subject: * complex.c (f_complex_polar): simple bug reproduced only when y is a float but x is not a float. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- complex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'complex.c') diff --git a/complex.c b/complex.c index 365fb7ad17..50d53afcde 100644 --- a/complex.c +++ b/complex.c @@ -592,8 +592,8 @@ f_complex_polar(VALUE klass, VALUE x, VALUE y) y = DBL2NUM(imag); } else { + y = f_mul(x, DBL2NUM(sin(arg))); x = f_mul(x, DBL2NUM(cos(arg))); - y = f_mul(y, DBL2NUM(sin(arg))); if (canonicalization && f_zero_p(y)) return x; } return nucomp_s_new_internal(klass, x, y); -- cgit v1.2.3