Bill Allombert on Sun, 31 Oct 1999 23:01:52 +0100 (MET)

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Vec() bug?

Here a patch for:
? Vec("a")
? Vec("wo bu neng xie hanzi")
  ***   segmentation fault: bug in GP (please report).


>>   ceiling of x.  When x is in R, the result is the smallest integer
>>   greater than or equal to x.

>>   Notice that the negative powers of x are removed. This behavior seems
>>   not to be documented. Is this a bug? Shalom, Michael

Well ,it *is* documented:
ceiling of x.

Perhaps it's a bit too short!
Of course the second sentence does not apply.
(CVS version updated)

Index: src/basemath/gen3.c
RCS file: /home/megrez/cvsroot/pari/src/basemath/gen3.c,v
retrieving revision 1.6
diff -u -r1.6 gen3.c
--- src/basemath/gen3.c 1999/10/18 12:05:03     1.6
+++ src/basemath/gen3.c 1999/10/31 21:57:09
@@ -1935,7 +1935,7 @@

   if (!x) return cgetg(1,t_VEC);
   tx = typ(x);
-  if (is_scalar_t(tx) || is_rfrac_t(tx))
+  if (is_scalar_t(tx) || is_rfrac_t(tx) || tx==t_STR)
     y=cgetg(2,t_VEC); y[1]=lcopy(x);
     return y;