[oct-scm] [oct-git]OCT: A portable Lisp implementation for quad-double precision floats branch master updated. 25a15317f76cba7a1c38341edf5a418020e9b477

Raymond Toy rtoy at common-lisp.net
Mon Mar 7 21:05:21 UTC 2011

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "OCT:  A portable Lisp implementation for quad-double precision floats".

The branch, master has been updated
       via  25a15317f76cba7a1c38341edf5a418020e9b477 (commit)
      from  3d2184f115538262f60b359249d76fb1c4c7048d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 25a15317f76cba7a1c38341edf5a418020e9b477
Author: Raymond Toy <toy.raymond at gmail.com>
Date:   Mon Mar 7 15:48:05 2011 -0500

    Clean up printing and fix printing bug in non-cmucl.
    Clisp was printing #q(1 2) as #q(#q#q1 #q#q2).  This is caused by
    PRINT-OBJECT for QD-COMPLEX printing a #q in addition to a #q printed
    by QD-FORMAT.
    o Use the same PRINT-OBJECT method for qd-real for all Lisps.
    o Remove extraneous #q from PRINT-OBJECT method for qd-complex.
    o QD-FORMAT for cmucl needs to output #q.

diff --git a/qd-class.lisp b/qd-class.lisp
index 5cc3cb4..2134ef7 100644
--- a/qd-class.lisp
+++ b/qd-class.lisp
@@ -47,21 +47,9 @@
 	 :type %quad-double))
   (:documentation "Complex number consisting of QUAD-DOUBLE components"))
 (defmethod print-object ((qd qd-real) stream)
   (format stream "~/octi::qd-format/" (qd-value qd)))
-(defun print-qd (q stream)
-  (declare (type %quad-double q))
-  (if (or (float-infinity-p (qd-0 q))
-	  (float-nan-p (qd-0 q)))
-      (format stream "~/octi::qd-format/" q)
-      (format stream "#q~/octi::qd-format/" q)))
-(defmethod print-object ((qd qd-real) stream)
-  (print-qd (qd-value qd) stream))
 (defmethod make-qd ((x cl:float))
   (make-instance 'qd-real :value (make-qd-d (float x 1d0))))
@@ -69,7 +57,7 @@
   (make-instance 'qd-real :value (qd-value x)))
 (defmethod print-object ((qd qd-complex) stream)
-  (format stream "#q(~<#q~/octi::qd-format/ #q~/octi::qd-format/~:@>)"
+  (format stream "#q(~<~/octi::qd-format/ ~/octi::qd-format/~:@>)"
 	  (list (qd-real qd)
 		(qd-imag qd))))
diff --git a/qd-io.lisp b/qd-io.lisp
index 1df662e..40d7c90 100644
--- a/qd-io.lisp
+++ b/qd-io.lisp
@@ -303,6 +303,7 @@
 	((ext:float-nan-p (qd-0 arg))
 	 (qd-output-nan arg stream))
+	 (write-string "#q" stream)
 	 (qd-output-aux arg stream))))
 ;; This version has problems with roundoff.


Summary of changes:
 qd-class.lisp |   14 +-------------
 qd-io.lisp    |    1 +
 2 files changed, 2 insertions(+), 13 deletions(-)

OCT:  A portable Lisp implementation for quad-double precision floats

More information about the oct-cvs mailing list