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

ruby-changes:25651

From: tadf <ko1@a...>
Date: Sun, 18 Nov 2012 09:35:20 +0900 (JST)
Subject: [ruby-changes:25651] tadf:r37708 (trunk): * complex.c (read_comp): mathn compliant.

tadf	2012-11-18 09:35:06 +0900 (Sun, 18 Nov 2012)

  New Revision: 37708

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

  Log:
    * complex.c (read_comp): mathn compliant.
    * rational.c (read_num): ditto.

  Modified files:
    trunk/ChangeLog
    trunk/complex.c
    trunk/rational.c

Index: complex.c
===================================================================
--- complex.c	(revision 37707)
+++ complex.c	(revision 37708)
@@ -1646,14 +1646,14 @@
     if (isimagunit(**s)) {
 	(*s)++;
 	num = INT2FIX((sign == '-') ? -1 : + 1);
-	*ret = rb_complex_raw2(ZERO, num);
+	*ret = rb_complex_new2(ZERO, num);
 	return 1; /* e.g. "i" */
     }
 
     if (!read_rat_nos(s, strict, b)) {
 	**b = '\0';
 	num = str2num(bb);
-	*ret = rb_complex_raw2(num, ZERO);
+	*ret = rb_complex_new2(num, ZERO);
 	return 0; /* e.g. "1/" */
     }
     **b = '\0';
@@ -1661,7 +1661,7 @@
 
     if (isimagunit(**s)) {
 	(*s)++;
-	*ret = rb_complex_raw2(ZERO, num);
+	*ret = rb_complex_new2(ZERO, num);
 	return 1; /* e.g. "3i" */
     }
 
@@ -1674,7 +1674,7 @@
 	**b = '\0';
 	if (strlen(bb) < 1 ||
 	    !isdigit((unsigned char)*(bb + strlen(bb) - 1))) {
-	    *ret = rb_complex_raw2(num, ZERO);
+	    *ret = rb_complex_new2(num, ZERO);
 	    return 0; /* e.g. "1@x" */
 	}
 	num2 = str2num(bb);
@@ -1692,23 +1692,23 @@
 	    num2 = INT2FIX((sign == '-') ? -1 : + 1);
 	else {
 	    if (!read_rat_nos(s, strict, b)) {
-		*ret = rb_complex_raw2(num, ZERO);
+		*ret = rb_complex_new2(num, ZERO);
 		return 0; /* e.g. "1+xi" */
 	    }
 	    **b = '\0';
 	    num2 = str2num(bb);
 	}
 	if (!isimagunit(**s)) {
-	    *ret = rb_complex_raw2(num, ZERO);
+	    *ret = rb_complex_new2(num, ZERO);
 	    return 0; /* e.g. "1+3x" */
 	}
 	(*s)++;
-	*ret = rb_complex_raw2(num, num2);
+	*ret = rb_complex_new2(num, num2);
 	return 1; /* e.g. "1+2i" */
     }
     /* !(@, - or +) */
     {
-	*ret = rb_complex_raw2(num, ZERO);
+	*ret = rb_complex_new2(num, ZERO);
 	return 1; /* e.g. "3" */
     }
 }
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 37707)
+++ ChangeLog	(revision 37708)
@@ -1,5 +1,10 @@
+Sun Nov 18 09:31:47 2012  Tadayoshi Funaba  <tadf@d...>
+
+	* complex.c (read_comp): mathn compliant.
+	* rational.c (read_num): ditto.
+
 Sun Nov 18 02:50:12 2012  Luis Lavena <luislavena@g...>
-
+ 
 	* win32/file.c (replace_to_long_name): correct logic around wildcard
 	  characters detection and ensure wide-chars are used as pattern.
 	  [ruby-core:49451] [Bug #7374]
Index: rational.c
===================================================================
--- rational.c	(revision 37707)
+++ rational.c	(revision 37708)
@@ -2011,13 +2011,13 @@
 {
     VALUE ip, fp, exp;
 
-    *num = rb_rational_raw2(ZERO, ONE);
+    *num = rb_rational_new2(ZERO, ONE);
     exp = Qnil;
 
     if (**s != '.') {
 	if (!read_digits(s, strict, &ip, NULL))
 	    return 0;
-	*num = rb_rational_raw2(ip, ONE);
+	*num = rb_rational_new2(ip, ONE);
     }
 
     if (**s == '.') {

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

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