mes: string->number: Support upper case hex.

* module/mes/scm.mes (string->number): Support upper case hex.
This commit is contained in:
Jan Nieuwenhuizen 2018-05-21 06:51:21 +02:00
parent cfda148e1e
commit 7f712e4555
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273

View file

@ -246,6 +246,11 @@
(<= i (char->integer #\f)))
(let ((d (char->integer #\a)))
(loop (cdr lst) (+ (* n radix) (- i (- d 10))))))
((and (= radix 16)
(>= i (char->integer #\A))
(<= i (char->integer #\F)))
(let ((d (char->integer #\A)))
(loop (cdr lst) (+ (* n radix) (- i (- d 10))))))
((= i (char->integer #\.)) ; minimal FLOAT support
(let ((fraction (cdr lst)))
(if (null? fraction) n