[pg-cvs] CVS pg
emarsden
emarsden at common-lisp.net
Sat Dec 16 13:24:10 UTC 2006
Update of /project/pg/cvsroot/pg
In directory clnet:/tmp/cvs-serv31715
Modified Files:
parsers.lisp
Log Message:
Fix numeric parser for negative numbers. From levente.meszaros at gmail.com
--- /project/pg/cvsroot/pg/parsers.lisp 2006/10/22 19:29:47 1.9
+++ /project/pg/cvsroot/pg/parsers.lisp 2006/12/16 13:24:09 1.10
@@ -133,7 +133,9 @@
(when (> dec-str-len 0)
;; parse integer after #\. and divide by 10^(digits), i.e. ".023" => 23/1000
(setq decimal-part (/ (parse-integer decimal-str) (expt 10 dec-str-len))))))
- (+ integer-part decimal-part)))
+ (if (eq #\- (elt str 0))
+ (- integer-part decimal-part)
+ (+ integer-part decimal-part))))
;; FIXME switch to a specialized float parser that conses less
(defun float-parser (str)
More information about the Pg-cvs
mailing list