[前][次][番号順一覧][スレッド一覧]

ruby-changes:7923

From: tadf <ko1@a...>
Date: Sun, 21 Sep 2008 14:00:04 +0900 (JST)
Subject: [ruby-changes:7923] Ruby:r19444 (trunk): trivial changes.

tadf	2008-09-21 13:59:53 +0900 (Sun, 21 Sep 2008)

  New Revision: 19444

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19444

  Log:
    trivial changes.

  Modified files:
    trunk/complex.c

Index: complex.c
===================================================================
--- complex.c	(revision 19443)
+++ complex.c	(revision 19444)
@@ -456,29 +456,31 @@
 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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]