Math Module

Python provides built in methods to perform mathematical operations.

max() and min()

max() and min() function allow us to get maximum an minimum number.

OUTPUT:

pow()

pow() function allow us to get the power of given number.

OUTPUT:

Pow = 64

sqrt()

sqrt() function allows us to get the square root of given number.

OUTPUT:
Pow = 8.0

trunc()

trunc() function will extract integer part from the number.

OUTPUT:

floor()

floor() function will return smallest nearest round off integer number.

OUTPUT:

ceil()

ceil() function is just opposite of floor() function. ceil() will return nearest round off integer number.

OUTPUT:

isnan()

isnan() function will return True if current value is not a number.

OUTPUT:

Imran Khan, Adobe Community Advisor, AEM certified developer and Java Geek, is an experienced AEM developer with over 11 years of expertise in designing and implementing robust web applications. He leverages Adobe Experience Manager, Analytics, and Target to create dynamic digital experiences. Imran possesses extensive expertise in J2EE, Sightly, Struts 2.0, Spring, Hibernate, JPA, React, HTML, jQuery, and JavaScript.

0