Tuesday, December 24, 2024
Google search engine
HomeLanguagessympy.frac() method in Python

sympy.frac() method in Python

The sympy.frac(x) function represents the fractional part of x. For real numbers, it is defined as, x – [x] 
 

Syntax : sympy.frac() 

Return : Return the simplified mathematical expression. 

Example #1 : 

Python3




# import sympy 
from sympy import *
    
# Use sympy.frac() method 
gfg = frac(5.36)
      
print(gfg)


Output : 

0.36

Example #2 :

Python3




# import sympy 
from sympy import *
    
# Use sympy.frac() method 
gfg = frac(Rational(7, 5))
      
print(gfg)


Output : 

2 / 5

Dominic Rubhabha-Wardslaus
Dominic Rubhabha-Wardslaushttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Recent Comments