This is the mail archive of the
guile@cygnus.com
mailing list for the Guile project.
Bug in numbers.c
- To: guile@sourceware.cygnus.com
- Subject: Bug in numbers.c
- From: Lorentey Karoly <lorentey@valerie.inf.elte.hu>
- Date: Sat, 31 Jul 1999 04:41:22 +0200 (CEST)
- cc: Jim Blandy <jimb@red-bean.com>
- Reply-To: Lorentey Karoly <lorentey@valerie.inf.elte.hu>
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