Rational Number
Representing the rational numbers using the Rational() method.
Python3
from sympy import Rational r_number = Rational( 2 , 5 ) r_number |
Output
Explanation: Rational method accepts two numbers which are the numerator and denominator of rational numbers and represents them in rational form as a/b.
What is Symbolic Computation in SymPy?
In this article, we are going to see how to perform symbolic computation in Sympy in Python.
Symbolic Computation in Sympy is used to solve mathematical expressions by integrating mathematics with computer science using mathematical symbols. It manipulates mathematical objects and expressions. Sympy evaluates algebraic expressions exactly using traditional mathematical symbols but not approximately.
Let’s look into an example to differentiate Sympy mathematical operation and normal mathematical operation.