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

ruby-changes:25648

From: tadf <ko1@a...>
Date: Sun, 18 Nov 2012 02:04:03 +0900 (JST)
Subject: [ruby-changes:25648] tadf:r37705 (trunk): * complex.c (read_comp): modified handling of polar form.

tadf	2012-11-18 02:03:52 +0900 (Sun, 18 Nov 2012)

  New Revision: 37705

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

  Log:
    * complex.c (read_comp): modified handling of polar form.

  Modified files:
    trunk/ChangeLog
    trunk/complex.c

Index: complex.c
===================================================================
--- complex.c	(revision 37704)
+++ complex.c	(revision 37705)
@@ -1672,14 +1672,13 @@
 
 	(*s)++;
 	bb = *b;
-	if (!(isdigit((unsigned char)**s) ||
-	      **s == '-' || **s == '+' ||
-	      **s == '.')) {
+	st = read_rat(s, strict, b);
+	**b = '\0';
+	if (strlen(bb) < 1 ||
+	    !isdigit((unsigned char)*(bb + strlen(bb) - 1))) {
 	    *ret = rb_complex_raw2(num, ZERO);
 	    return 0; /* e.g. "1@x" */
 	}
-	st = read_rat(s, strict, b);
-	**b = '\0';
 	num2 = str2num(bb);
 	*ret = rb_complex_polar(num, num2);
 	if (!st)
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 37704)
+++ ChangeLog	(revision 37705)
@@ -1,3 +1,7 @@
+Sun Nov 18 02:02:46 2012  Tadayoshi Funaba  <tadf@d...>
+
+	* complex.c (read_comp): modified handling of polar form.
+
 Sun Nov 18 00:50:44 2012  Tadayoshi Funaba  <tadf@d...>
 
 	* complex.c (read_comp): fixed handling of polar form.

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

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