summaryrefslogtreecommitdiffstats
path: root/complex.c
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-21 04:59:53 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-21 04:59:53 +0000
commit8fe6e4269ef8923b73a035be4712ce8c65dd9eb4 (patch)
treebd8db65a5958290bca5c7a0ea8bda6fd7a9e5528 /complex.c
parent594999f2819954a0220613ec67cb383880f41223 (diff)
downloadruby-8fe6e4269ef8923b73a035be4712ce8c65dd9eb4.tar.gz
ruby-8fe6e4269ef8923b73a035be4712ce8c65dd9eb4.tar.xz
ruby-8fe6e4269ef8923b73a035be4712ce8c65dd9eb4.zip
trivial changes.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'complex.c')
-rw-r--r--complex.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/complex.c b/complex.c
index e5a75460c..442aa6958 100644
--- a/complex.c
+++ b/complex.c
@@ -456,29 +456,31 @@ m_log_bang(VALUE x)
static VALUE
m_cos(VALUE x)
{
- get_dat1(x);
-
if (f_real_p(x))
return m_cos_bang(x);
- return f_complex_new2(rb_cComplex,
- f_mul(m_cos_bang(dat->real),
- m_cosh_bang(dat->imag)),
- f_mul(f_negate(m_sin_bang(dat->real)),
- m_sinh_bang(dat->imag)));
+ {
+ get_dat1(x);
+ return f_complex_new2(rb_cComplex,
+ f_mul(m_cos_bang(dat->real),
+ m_cosh_bang(dat->imag)),
+ f_mul(f_negate(m_sin_bang(dat->real)),
+ m_sinh_bang(dat->imag)));
+ }
}
static VALUE
m_sin(VALUE x)
{
- get_dat1(x);
-
if (f_real_p(x))
return m_sin_bang(x);
- return f_complex_new2(rb_cComplex,
- f_mul(m_sin_bang(dat->real),
- m_cosh_bang(dat->imag)),
- f_mul(m_cos_bang(dat->real),
- m_sinh_bang(dat->imag)));
+ {
+ get_dat1(x);
+ return f_complex_new2(rb_cComplex,
+ f_mul(m_sin_bang(dat->real),
+ m_cosh_bang(dat->imag)),
+ f_mul(m_cos_bang(dat->real),
+ m_sinh_bang(dat->imag)));
+ }
}
static VALUE