[noctool-cvs] CVS source
jprewett
jprewett at common-lisp.net
Sat Jun 21 11:07:36 UTC 2008
Update of /project/noctool/cvsroot/source
In directory clnet:/tmp/cvs-serv24095
Modified Files:
graphing.lisp
Log Message:
Modified SHOW method for PERCENTILE-GRAPH-DISPLAY class so that the
computation of the scale won't cause a DIVISION-BY-ZERO error when the
max of the selected data is 0.
--- /project/noctool/cvsroot/source/graphing.lisp 2008/06/20 12:19:57 1.4
+++ /project/noctool/cvsroot/source/graphing.lisp 2008/06/21 11:07:36 1.5
@@ -267,7 +267,8 @@
(let ((tmpdata (sort (copy-seq data) #'<)))
(let ((percentile (aref tmpdata (round (* (length tmpdata) (/ (percentile graph) 100))))))
(let ((scale (or scale (if (zerop percentile)
- (/ height (reduce #'max tmpdata))
+ (/ height (let ((max (reduce #'max tmpdata)))
+ (if (eql 0 max) 1 max)))
(/ height percentile)))))
(loop for n from 0
for value across data
More information about the noctool-cvs
mailing list