Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 1238 by nicolas.pourcelot: Real don't manage unicode argument
http://code.google.com/p/sympy/issues/detail?id=1238

Using sympy 0.6.3, Real has a strange behaviour if you use unicode as  
argument:

>>> pi="3.14159265358979323846264338327950288419716939937510582097494"
>>> sympy.Real(pi,60)
3.14159265358979323846264338327950288419716939937510582097494

That's ok.

And then, the same with unicode :

>>> pi=u"3.14159265358979323846264338327950288419716939937510582097494"
>>> sympy.Real(pi,60)
3.14159265358979311599796346854418516159057617187500000000000

This may be patch this way :
in sympy/core/numbers.py
replace
        if isinstance(num, (str, decimal.Decimal)):
             _mpf_ = mlib.from_str(str(num), prec, rnd)
by
        if isinstance(num, (str, unicode, decimal.Decimal)):
             _mpf_ = mlib.from_str(str(num), prec, rnd)

Thanks a lot !

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy-issues" 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/sympy-issues?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to