On Wed, Nov 12, 2008 at 9:06 AM, Jason Grout <[EMAIL PROTECTED]> wrote: > > Python supports creating complex numbers using the following syntax: > > imagnumber ::= (floatnumber | intpart) ("j" | "J") > > Right now, the preparser botches this and makes it give an error: > > sage: 1j > ------------------------------------------------------------ > File "<ipython console>", line 1 > Integer(1)j > ^ > SyntaxError: invalid syntax > > > Currently, if we use "raw" numbers, things work: > > sage: 1rj > 1j > sage: 1rj == complex('j') > True > > However, the preparser probably ought to be fixed so that it supports > the python syntax. The ticket is: > > http://trac.sagemath.org/sage_trac/ticket/4501 > > Mike Hansen detailed a possible fix that is noted on the ticket. > However, it leaves a question open: > > Should "1j" in Sage give a Sage complex number or a python complex > number? Giving a Sage complex number would probably be more consistent, > with 1jr giving a python complex number. >
I vote for 1j being the Python complex number. This is because the only people I can ever imagine using the notation "j" in Sage are numerical numpy-type users who would be very annoyed to get Sage complex numbers ever. William --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---