Commit b76e1c8c authored by Pascal J. Bourguignon's avatar Pascal J. Bourguignon

00041: fixed.

parent f00432b0
This diff is collapsed.
This diff is collapsed.
......@@ -660,14 +660,8 @@ code ASCII est CO."
Résultat: une chaîne de caractère contenant la représentation du
nombre A au format U."
(let* ((ca (deref *vm* ca))
(ca (un-nombre ca))
(value (abs ca)))
(format nil (cond
((and (<= 1e-3 value) (< value 1e6)) "~A")
(t "~,,2,,,,'EE"))
(if (= ca (truncate ca))
(truncate ca)
ca))))
(ca (un-nombre ca)))
(format nil "~/COM.INFORMATIMAGO.LSE::FMT-U/" ca)))
(defun set-va (va value)
......
......@@ -515,18 +515,33 @@ RETURN: vm
(afficher-with-format vm ctrl val)))
(defun fmt-u (stream value colon atsign)
"
U -> ~/fmt-u/
"
(declare (ignore colon atsign))
(etypecase value
((or integer nombre)
(let ((mag (abs value)))
(format stream (if (or (zerop mag)
(and (<= 1e-3 (abs mag)) (< (abs mag) 1e6)))
"~A"
"~,,2,,,,'EE")
;; convert to integer when there's no significant decimal digit:
(let ((tvalue (truncate value)))
(if (= tvalue value)
tvalue
value)))))
(string
(format stream "~A" value)))
(values))
(defun afficher-u (vm value)
(let ((value (deref vm value)))
(etypecase value
((or integer nombre)
(io-format *task* (if (or (zerop value)
(and (<= 1e-3 (abs value)) (< (abs value) 1e6)))
"~A "
"~,,2,,,,'EE ")
(let ((tvalue (truncate value)))
(if (= tvalue value)
tvalue
value))))
(io-format *task* "~/COM.INFORMATIMAGO.LSE::FMT-U/ " value))
(chaine
(io-format *task* "~A" value))
((or vector array)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment