This is the mail archive of the guile@cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Bug in numbers.c



Hi,

I have just built Guile from the latest CVS sources, and noticed that
complex numbers stopped working correctly.  It seems that `scm_makdbl'
fails to set the imaginary part of the newly allocated smob, because of a
small bug in libguile/number.c.  Here is a quick fix:

--- guile-core-orig/libguile/numbers.c  Wed Jul  7 11:43:50 1999
+++ guile-core/libguile/numbers.c       Sat Jul 31 03:25:42 1999
@@ -2470,7 +2470,8 @@
     }
   else
     {
-      SCM_NEWSMOB(z,scm_tc_dblc,scm_must_malloc (2L * sizeof (double), "comkplex"));
+      SCM_NEWSMOB(z,scm_tc_dblc,scm_must_malloc (2L * sizeof (double), "complex"));
+      SCM_IMAG (z) = y;
     }
   SCM_REAL (z) = x;
   SCM_ALLOW_INTS;


Cheers,
-- 
       Lorentey Karoly

(o_         ELTE TTK Prog. Mat.
//\   mail: <lorentey@valerie.inf.elte.hu>
V_/_  web:  http://valerie.inf.elte.hu/~lorentey



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]