From: Raymond T. <rt...@us...> - 2014-07-17 02:47:49
|
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 "Maxima CAS". The branch, master has been updated via 4179eaa0997919251de46667b6ad0980a3e311a6 (commit) via a2bfa4211dc57cc42eb17681d8e38a82afbccc81 (commit) via 4a3b693cdf62339a0a6933c4e158225513dede44 (commit) from 34932c523c2b498da665a19f717055f701857e8f (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 4179eaa0997919251de46667b6ad0980a3e311a6 Author: Raymond Toy <rt...@go...> Date: Wed Jul 16 19:37:43 2014 -0700 Allow printing of bigfloats along with regular CL numbers. Note this only works if the specified format supports bigfloats. Hence use ~/bigfloat::format-e/ and ~/bigfloat::format-f/ in that case. diff --git a/src/numerical/f2cl-lib.lisp b/src/numerical/f2cl-lib.lisp index b7fe074..69ba309 100644 --- a/src/numerical/f2cl-lib.lisp +++ b/src/numerical/f2cl-lib.lisp @@ -1259,7 +1259,7 @@ causing all pending operations to be flushed" (arg-list (apply #'append (map 'list #'(lambda (x) - (cond ((numberp x) + (cond ((bigfloat:numberp x) (list x)) ((stringp x) (list x)) commit a2bfa4211dc57cc42eb17681d8e38a82afbccc81 Author: Raymond Toy <rt...@go...> Date: Wed Jul 16 19:34:54 2014 -0700 Fix bug in outputting the padchar. The padchar can be nil. diff --git a/src/numeric.lisp b/src/numeric.lisp index 5c4fb38..c13a252 100755 --- a/src/numeric.lisp +++ b/src/numeric.lisp @@ -2236,9 +2236,9 @@ (if overflowchar (format s "'~C," overflowchar) (write-string "," s)) - (if (char= padchar #\space) - (write-string "," s) - (format s "'~C," padchar)) + (if padchar + (format s "'~C," padchar) + (write-string "," s)) (when exponentchar (format s "'~C" exponentchar)) (when colonp commit 4a3b693cdf62339a0a6933c4e158225513dede44 Author: Raymond Toy <rt...@go...> Date: Wed Jul 16 19:33:54 2014 -0700 Fix bugs in ~E printer o Take the absolute value of the number before calling fpformat to print the number. If not, an extra negative sign is printed. o When printing the exponent, take the absolute value of exponent. If not, the computed length is too long and causes the entire output to be the overflowchar (if given). diff --git a/src/float.lisp b/src/float.lisp index 4600fe7..2bf52a8 100644 --- a/src/float.lisp +++ b/src/float.lisp @@ -211,8 +211,6 @@ One extra decimal digit in actual representation for rounding purposes.") (explodec (1- (cadr l)))))))) -;; Format bfloats using ~E format. This is suitable as a ~// format. -;; ;; NOTE: This is a modified version of FORMAT-EXP-AUX from CMUCL to ;; support printing of bfloats. (defun bfloat-format-e (stream arg colonp atp @@ -237,7 +235,7 @@ One extra decimal digit in actual representation for rounding purposes.") 1 (1+ fdigits)) 0)) - (f (fpformat x)) + (f (fpformat (bcons (fpabs (cdr x))))) (marker (position '|b| f)) (digits (remove '|.| (subseq f 0 marker)))) ;; Depending on the value of k, move the decimal @@ -288,7 +286,7 @@ One extra decimal digit in actual representation for rounding purposes.") (expt (if (zerop (second arg)) 0 (1+ (- num-expt k)))) - (estr (format nil "~D" expt)) + (estr (format nil "~D" (abs expt))) (elen (if e (max (length estr) e) (length estr))) (add-zero-p nil)) (cond ((and w overflowchar e (> elen e)) @@ -373,6 +371,8 @@ One extra decimal digit in actual representation for rounding purposes.") (write-string estr stream))))))))) (values)) +;; NOTE: This is a modified version of FORMAT-FIXED-AUX from CMUCL to +;; support printing of bfloats. (defun bfloat-format-f (stream number colonp atsign &optional w d (k 0) ovf (pad #\space)) (labels ((exponent-value (x) ----------------------------------------------------------------------- Summary of changes: src/float.lisp | 8 ++++---- src/numeric.lisp | 6 +++--- src/numerical/f2cl-lib.lisp | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) hooks/post-receive -- Maxima CAS |