Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

On the other hand, not many languages use lowercase 'i' for complex number literals, in fact I can't think of any right now.


Scheme and Racket use i in complex numbers, for example:

(* 2+3i 4+5i) ;=> -7+22i


I can't even think of a language that has first class complex numbers, let alone complex number literals.


Python does.

    >>> 5 + 2j
    (5+2j)
    >>> 2j * 2j
    (-4+0j)



C?

     #include <complex.h>
     complex f(complex a, complex b) {
         return a*b + 5*I;
     }


MATLAB


Ruby 2.1 does.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: