Skip to content

Commit

Permalink
power of number
Browse files Browse the repository at this point in the history
  • Loading branch information
rizalfahlevi8 committed Jun 9, 2024
1 parent df95ade commit 93d53d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h1 class="text-center mt-3">Scientific Calculator</h1>
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="operator('-','-')">-</button>
</div>
<div class="row justify-content-center">
<button class="btn col-2 mx-md-2 mx-1 mb-2">x <span style="position: relative; bottom: .7em; right: .3em; font-size:xx-small;">y</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="operator('**','^')">x <span style="position: relative; bottom: .7em; right: .3em; font-size:xx-small;">y</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="number(0)">0</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="number('.')">.</button>
<button id="calculate" class="btn col-2 mx-md-2 mx-1 mb-2" onclick="calculate()">=</button>
Expand Down
16 changes: 8 additions & 8 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function logaritma() {
log = Math.log10(data.staging.join(''));
data.result = log;
data.formats.push(`log(${i})`);
data.resultformat.push('aktif');
data.resultformat.push('active');
result.value = data.result;
operation.value = data.formats.join('');
data.staging = [];
Expand All @@ -103,7 +103,7 @@ function logaritma() {
} else {
data.formats.push(`log(${i})`);
}
data.resultformat.push('aktif');
data.resultformat.push('active');
result.value = data.result;
operation.value = data.formats.join('');
console.log(log);
Expand All @@ -117,7 +117,7 @@ function logNatural() {
ln = Math.log(data.staging.join(''));
data.result = ln;
data.formats.push(`ln(${i})`);
data.resultformat.push('aktif');
data.resultformat.push('active');
result.value = data.result;
operation.value = data.formats.join('');
data.staging = [];
Expand All @@ -134,7 +134,7 @@ function logNatural() {
} else {
data.formats.push(`ln(${i})`);
}
data.resultformat.push('aktif');
data.resultformat.push('active');
result.value = data.result;
operation.value = data.formats.join('');
}
Expand All @@ -147,7 +147,7 @@ function squareRoot() {
sqrt = Math.sqrt(data.staging.join(''));
data.result = sqrt;
data.formats.push(`√(${i})`);
data.resultformat.push('aktif');
data.resultformat.push('active');
result.value = data.result;
operation.value = data.formats.join('');
data.staging = [];
Expand All @@ -164,7 +164,7 @@ function squareRoot() {
} else {
data.formats.push(`√(${i})`);
}
data.resultformat.push('aktif');
data.resultformat.push('active');
result.value = data.result;
operation.value = data.formats.join('');
}
Expand All @@ -177,7 +177,7 @@ function factorial(){
fact = factorialCalculation(data.staging.join(''));
data.result = fact;
data.formats.push(`fact(${i})`);
data.resultformat.push('aktif');
data.resultformat.push('active');
result.value = data.result;
operation.value = data.formats.join('');
data.staging = [];
Expand All @@ -193,7 +193,7 @@ function factorial(){
} else {
data.formats.push(`fact(${i})`);
}
data.resultformat.push('aktif');
data.resultformat.push('active');
result.value = data.result;
operation.value = data.formats.join('');
}
Expand Down

0 comments on commit 93d53d3

Please sign in to comment.