Python | sympy.Integer() method
Last Updated :
14 Jul, 2019
With the help of sympy.Integer()
method, we can convert the floating point to integer values and this method very efficient in term of memory if we want to save integer value.
Syntax : sympy.Integer()
Return : Return integer value.
Example #1 :
In this example we can see that by using sympy.Integer()
method, we are able to convert the floating values to integer or optimize memory consumption.
from sympy import *
gfg = Integer( 50 ) + Integer( 50 )
print (gfg)
|
Output :
100
Example #2 :
from sympy import *
gfg = Integer( 12.36 ) + Integer( 8.98 )
print (gfg)
|
Output :
20
Share your thoughts in the comments
Please Login to comment...