File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ function calculateSumOfAllDigits(number, power) {
2525 for ( let i = 0 ; i < numberString . length ; i ++ ) {
2626 //repeat for each digit
2727 const digit = parseInt ( numberString [ i ] , 10 ) ; //convert string to integer
28- sum += digit ** power ; //get power of digit then add digit to sum
28+ sum += digit ** power ; //get power root of digit then add digit to sum
2929 }
3030 return sum ; //return sum of all digits
3131}
@@ -40,7 +40,7 @@ function calculateSumOfIntegerDigits(number, power) {
4040 for ( let i = 0 ; i < integerString . length ; i ++ ) {
4141 //repeat for each digit
4242 const digit = parseInt ( integerString [ i ] , 10 ) ; //convert string to integer
43- sum += digit ** power ; //get power of digit then add digit to sum
43+ sum += digit ** power ; //get power root of digit then add digit to sum
4444 }
4545 return sum ; //return sum of integer digits
4646}
Original file line number Diff line number Diff line change 11<!doctype html>
22< html lang ="en ">
33 < head >
4- < title > Sum of Power of Digits Calculator</ title >
4+ < title > Sum of Power Root of Digits Calculator</ title >
55 </ head >
66 < body >
7- < h1 > Sum of Power of Digits Calculator</ h1 >
7+ < h1 > Sum of Power Root of Digits Calculator</ h1 >
88 < input type ="number " id ="numberInput " />
99 Power: < input type ="number " min ="1 " step ="1 " id ="powerInput " />
1010 < select id ="option ">
You can’t perform that action at this time.
0 commit comments