aboutsummaryrefslogtreecommitdiffstats
path: root/complex.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-22 11:57:43 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-22 11:57:43 +0000
commit53800de4c5ed2eb436771bc3b42da87699002d2e (patch)
tree2b5fd1f4f1fc416d2fd64f1d4a7b3a384c77ca5e /complex.c
parent9513b3d9b59f274164820b95cd3b4e954c490f9e (diff)
downloadruby-53800de4c5ed2eb436771bc3b42da87699002d2e.tar.gz
* 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
Diffstat (limited to 'complex.c')
-rw-r--r--complex.c2
1 files changed, 1 insertions, 1 deletions
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);