Skip to content

Conversation

HimanshuGupta-p1
Copy link
Contributor

Function to calculate x raised to the power n (i.e., x^n) where x is a float number and n is an integer and it will return a float value.

Example 1:

Input: x = 2.00000, n = 10
Output: 1024.0
Example 2:

Input: x = 2.10000, n = 3
Output: 9.261000000000001

Example 3:

Input: x = 2.00000, n = -2
Output: 0.25
Explanation: 2^-2 = 1/(2^2) = 1/4 = 0.25

Copy link
Contributor

@NitkarshChourasia NitkarshChourasia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All done!

@@ -0,0 +1,58 @@
# Assign values to author and version.
__author__ = "Himanshu Gupta"
__version__ = "1.0.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

Output: 1024.0
Example 2:

Input: x = 2.10000, n = 3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay


if __name__ == "__main__":
print(f"Author: {__author__}")
print(f"Version: {__version__}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please merge to the master branch of geek-computers

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It will be taken care, don't worry.

@geekcomputers geekcomputers merged commit f09c995 into geekcomputers:master Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants