math.pow()
Anonymous contributor
Anonymous contributor4 total contributions
Anonymous contributor
Published May 21, 2021Updated Aug 6, 2023
Contribute to Docs
Returns the float
value of x
raised to the power of y
.
Syntax
math.pow(x, y)
This contrasts with the built-in **
operator in that math.pow()
converts both its arguments to type float
.
Example 1
Use math.pow()
to return 5
to the power of 3
:
import mathprint(math.pow(5, 3))# Output: 125.0
Example 2
Use math.pow()
to return 5.5
to the power of 3.3
:
import mathprint(math.pow(5.5, 3.3))# Output: 277.457759723262
Codebyte Example
The following code is runnable and demonstrates the use of math.pow()
:
All contributors
- Anonymous contributorAnonymous contributor4 total contributions
- christian.dinh2481 total contributions
- Anonymous contributorAnonymous contributor3077 total contributions
- Anonymous contributorAnonymous contributor194 total contributions
- Anonymous contributor
- christian.dinh
- Anonymous contributor
- Anonymous contributor
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.