Commit cc02fb30 authored by Eric Marsden's avatar Eric Marsden

Fix numeric parser for negative numbers. From

parent ecceccac
......@@ -133,7 +133,9 @@ Needed to define the type of objects in pg-prepare")
(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)
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