On 17/06/13 11:25, bob gailer wrote:
On 6/15/2013 5:53 AM, Amit Saha wrote:
Symbolic math?
What is that?
Algebra, calculus and similar.
py> import sympy
py> x = sympy.Symbol('x')
py> ((x + 2)**3).expand()
x**3 + 6*x**2 + 12*x + 8
Where possible, it calculates exact mathematical results:
py> sympy.sin(3*sympy.pi/4)
2**(1/2)/2
compared to floating point approximations:
py> import math
py> math.sin(3*math.pi/4)
0.7071067811865476
--
Steven
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor