unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Kevin Ryde <user42@zip.com.au>
Subject: scm_product complex*big gremlin
Date: Fri, 18 Jul 2003 09:30:34 +1000	[thread overview]
Message-ID: <87oezs20kl.fsf@zip.com.au> (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

                 reply	other threads:[~2003-07-17 23:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87oezs20kl.fsf@zip.com.au \
    --to=user42@zip.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).