justinethier/cyclone

+i and -i are not bound; (sqrt -1) evaluates to NAN

chebert opened this issue · 3 comments

I'm trying it out in the browser.

> +i
Error: Unbound variable: +i 
> -i
Error: Unbound variable: -i 

> (sqrt -1)
-nan.0

> (complex? (sqrt -1))
#f

This works:

> +1i
1.0i

> (complex? +1i)
#t

+i and -i shouldn't be identifiers, but they are:

> (define +i +1i)
ok
> (define -i -1i)
ok

Thanks for the report @chebert, this is great feedback! Let me see what it will take to get this fixed up...

Fixed sqrt to properly return complex numbers. Next step is +i and -i...

This has been fixed on the master branch. Unfortunately there were a few loose ends as complex numbers support is a fairly recent change.

Thanks again for the report!