hex integer constants.
Fixes: debbugs:17807
+2014-06-19 William Xu <william.xwl@gmail.com>
+
+ * progmodes/hideif.el (hif-string-to-number): Don't return float for
+ hex integer constants (bug#17807).
+
2014-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
* international/mule-util.el (truncate-string-ellipsis): New var.
(if (or (not base) (= base 10))
(string-to-number string base)
(let* ((parts (split-string string "\\." t "[ \t]+"))
- (frac (cadr parts))
- (quot (expt (* base 1.0) (length frac))))
- (/ (string-to-number (concat (car parts) frac) base) quot))))
+ (frac (cadr parts))
+ (quot (expt (* base 1.0) (length frac)))
+ (num (/ (string-to-number (concat (car parts) frac) base)
+ quot)))
+ (if (= num (truncate num))
+ (truncate num)
+ num))))
(defun hif-tokenize (start end)
"Separate string between START and END into a list of tokens."