#4325: CC() fails on Mathematica output
------------------------+---------------------------------------------------
Reporter: ddrake | Owner: was
Type: defect | Status: new
Priority: major | Milestone: sage-3.2
Component: interfaces | Keywords: mathematica
------------------------+---------------------------------------------------
Using 3.1.2 on sage.math:
{{{
sage: mathematica.eval('N[BesselK[1+I, 2+ 3*I], 20]')
-0.105203133241753451256 + 0.017589014615189905553 I
}}}
Now say I want to get a CC element out of that:
{{{
sage: CC(mathematica.eval('N[BesselK[1+I, 2+ 3*I], 20]'))
------------------------------------------------------------
File "<string>", line 1
-RealNumber('0.105203133241753451256')+RealNumber('0.017589014615189905553')I
^
SyntaxError: unexpected EOF while parsing
}}}
It's confused because Mathematica uses a space between the number and I; a
workaround is to put in an asterisk:
{{{
sage: CC(mathematica.eval('N[BesselK[1+I, 2+ 3*I], 20]').replace(' I',
'*I'))
-0.105203133241753 + 0.0175890146151899*I
}}}
I understand that this kind of parsing can get difficult and complicated,
but it seems like something we should aim for.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4325>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---