Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

power of number - functionality added #28

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions calc.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<button onclick="rBrac()" id="rBrac" class="symbool">)</button>
<button onclick="e()" id="e" class="symbool">e</button>
<button onclick="calcLog()" id="log" class="symbol">lg</button>
<button onclick="power()" id="power" class="symbol">pow</button>
</div>

<div class="symbolsUp">
Expand Down
11 changes: 9 additions & 2 deletions calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ function equal() {

}
input[0].value = `${value}`;
console.log(value);

// value=value.toString();

}
Expand Down Expand Up @@ -192,6 +190,15 @@ function zero() {
let value = input[0].value;
input[0].value = `${value}0`;
}

/****FIND POWER OF ANY NUMBER****/
function power() {
let click = document.getElementById("power");
btnClick(click);
let input = document.getElementsByClassName("input");
let value = input[0].value;
input[0].value = `${value}**`;
}
function e() {
let input = document.getElementsByClassName("input");
let value = input[0].value;
Expand Down