mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-06-06 13:29:56 +02:00
racket: correctly print exact non-integers
This commit is contained in:
parent
ac0c87564c
commit
e076be3c78
|
@ -2,5 +2,5 @@
|
||||||
(cond
|
(cond
|
||||||
[(void? x) #f]
|
[(void? x) #f]
|
||||||
;; Also show fractions as decimals.
|
;; 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)])))
|
[else (pretty-print x)])))
|
||||||
|
|
Loading…
Reference in a new issue