aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-18 14:24:15 +0000
committermrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-18 14:24:15 +0000
commit3695ae9e6bc86e95b7ad9da78b6c82a12e0cd531 (patch)
tree4944c8549445b4d1e67d12dcf25ac7d2e48668af
parentd7e07b9d24899569edbb9a3e9ff8a7410baa01aa (diff)
downloadruby-3695ae9e6bc86e95b7ad9da78b6c82a12e0cd531.tar.gz
complex.c: refactoring
* complex.c (nucomp_abs): use rb_math_hypot directly. * complex.c (nucomp_arg): use rb_math_atan2 directly. * complex.c (imp2, m_{atan2,hypot}_bang, m_hypot): removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--complex.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/complex.c b/complex.c
index 1a851dd3b5..7ecefcdf8a 100644
--- a/complex.c
+++ b/complex.c
@@ -432,20 +432,9 @@ m_##n##_bang(VALUE x)\
return rb_math_##n(x);\
}
-#define imp2(n) \
-inline static VALUE \
-m_##n##_bang(VALUE x, VALUE y)\
-{\
- return rb_math_##n(x, y);\
-}
-
-imp2(atan2)
imp1(cos)
imp1(cosh)
imp1(exp)
-imp2(hypot)
-
-#define m_hypot(x,y) m_hypot_bang((x),(y))
static VALUE
m_log_bang(VALUE x)
@@ -1015,7 +1004,7 @@ nucomp_abs(VALUE self)
a = f_to_f(a);
return a;
}
- return m_hypot(dat->real, dat->imag);
+ return rb_math_hypot(dat->real, dat->imag);
}
/*
@@ -1049,7 +1038,7 @@ static VALUE
nucomp_arg(VALUE self)
{
get_dat1(self);
- return m_atan2_bang(dat->imag, dat->real);
+ return rb_math_atan2(dat->imag, dat->real);
}
/*