I had this exact same question when I looked at the RacketScript issue lol.
The answer is https://docs.racket-lang.org/reference/numbers.html:
a complex number with an exact zero imaginary part is a real number.
--
You received this message because you are subscribed to the Google Groups "Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CAFfiA1%2BYygGrLH2rtwby8AWg7Edyvq-tzmANTNypq5Rqd-eXFw%40mail.gmail.com.
On Fri, Nov 19, 2021 at 3:13 PM Stephen Chang <stcha...@gmail.com> wrote:
>
> Lol I read that page and still didn't get it.
>
> Any opinion for a potential workaround?
It depends what you mean by "workaround". The distinction between
exact and inexact numbers is pretty deeply built-in to how Racket
numbers work, so there's not going to be a simple workaround that
fixes this issue.
For RacketScript I think the choices are (a) use floats for everything
and have semantics that diverge substantially from Racket or (b) have
a separate implementation of integers that's not JS numbers (maybe JS
bigints would work).
Sam
>
> To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CAFfiA1%2B3yRzzh%3DKhcOddt0geMezNsxQGHqzwGTYbZjLekUQ8kQ%40mail.gmail.com.