Fix remainder handling.

* mes/module/mes/scm.mes (number->string): Fix remainder handling.
* build-aux/check-mescc.sh (XFAIL_TESTS): Remove
lib/tests/scaffold/60-math.c.
This commit is contained in:
Danny Milosavljevic 2019-07-05 15:52:04 +02:00 committed by Jan Nieuwenhuizen
parent 5d1a3e9eda
commit 4b5d5017c4
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
2 changed files with 1 additions and 2 deletions

View File

@ -234,7 +234,6 @@ lib/tests/scaffold/91-goto-array.c
if test $mes_cpu = x86; then
XFAIL_TESTS="$XFAIL_TESTS
lib/tests/scaffold/60-math.c
"
fi

View File

@ -264,7 +264,7 @@
(let* ((radix (if (null? rest) 10 (car rest)))
(sign (if (< n 0) '(#\-) '())))
(let loop ((n (abs n)) (lst '()))
(let* ((i (remainder n radix))
(let* ((i (abs (remainder n radix)))
(lst (cons (integer->char (+ i (if (< i 10) (char->integer #\0)
(- (char->integer #\a) 10)))) lst))
(n (quotient n radix)))