racket: correctly print exact non-integers

This commit is contained in:
LordMZTE 2023-11-04 11:54:05 +01:00
parent ac0c87564c
commit e076be3c78
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6

View file

@ -2,5 +2,5 @@
(cond
[(void? x) #f]
;; Also show fractions as decimals.
[(and (rational? x) (not (integer? x))) (printf "~a = ~a" x (exact->inexact x))]
[(and (exact? x) (not (exact-integer? x))) (printf "~a = ~a" x (exact->inexact x))]
[else (pretty-print x)])))