-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from ays14/power
add method to calculate power of a number
- Loading branch information
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# doPower() | ||
|
||
> This function is used to get the power/exponent of a number. | ||
- @param {number} base `x` -> base number, whose power is calculated | ||
- @param {number} exponent `y` -> power/index for the number | ||
- @return {number} The power/exponent of the base number or say `x^y` | ||
|
||
## Syntax | ||
|
||
function(x, y) { ..code.. } | ||
|
||
## Parameters | ||
|
||
The function takes two parameters and return the output. | ||
|
||
## Example | ||
|
||
### Code: | ||
```js | ||
const calculator = require('all-round-calculator'); | ||
console.log(calculator.power(25,2)); | ||
``` | ||
|
||
### Output: | ||
```bash | ||
625 | ||
``` | ||
|
||
--- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54f181d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
all-round-calculator – ./
all-round-calculator.vercel.app
all-round-calculator-susmita-dey.vercel.app
all-round-calculator-git-main-susmita-dey.vercel.app