unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* scm_product complex*big gremlin
@ 2003-07-17 23:30 Kevin Ryde
  0 siblings, 0 replies; only message in thread
From: Kevin Ryde @ 2003-07-17 23:30 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 284 bytes --]

I applied a bit of a fix,

        * numbers.c (scm_product): In complex * bignum, correction to
        REAL/IMAG fetch, x is the complex, not y.

        * tests/numbers.test (*): Add complex/bignum test.

The 1.6 branch looks ok, this seems to have crept in some time since
then.


[-- Attachment #2: numbers.c.product.diff --]
[-- Type: text/plain, Size: 604 bytes --]

--- numbers.c.~1.193.~	2003-07-08 10:28:38.000000000 +1000
+++ numbers.c	2003-07-17 11:07:37.000000000 +1000
@@ -3320,8 +3320,8 @@
     } else if (SCM_BIGP (y)) {
       double z = mpz_get_d (SCM_I_BIG_MPZ (y));
       scm_remember_upto_here_1 (y);
-      return scm_make_complex (z * SCM_COMPLEX_REAL (y),
-			       z * SCM_COMPLEX_IMAG (y));
+      return scm_make_complex (z * SCM_COMPLEX_REAL (x),
+			       z * SCM_COMPLEX_IMAG (x));
     } else if (SCM_REALP (y)) {
       return scm_make_complex (SCM_REAL_VALUE (y) * SCM_COMPLEX_REAL (x),
 			       SCM_REAL_VALUE (y) * SCM_COMPLEX_IMAG (x));

[-- Attachment #3: numbers.test.product.diff --]
[-- Type: text/plain, Size: 312 bytes --]

--- numbers.test.~1.27.~	2003-07-18 09:26:26.000000000 +1000
+++ numbers.test	2003-07-18 09:29:08.000000000 +1000
@@ -1790,6 +1790,13 @@
 ;;; *
 ;;;
 
+(with-test-prefix "*"
+
+  (pass-if "complex * bignum"
+    (let ((big (ash 1 90)))
+      (= (make-rectangular big big)
+	 (* 1+1i big)))))
+
 ;;;
 ;;; /
 ;;;

[-- Attachment #4: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-07-17 23:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-17 23:30 scm_product complex*big gremlin Kevin Ryde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).