We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Math.pow
long
Armstrong
1 parent f8de290 commit fc21a8bCopy full SHA for fc21a8b
src/main/java/com/thealgorithms/maths/Armstrong.java
@@ -27,7 +27,7 @@ public boolean isArmstrong(int number) {
27
28
while (originalNumber > 0) {
29
long digit = originalNumber % 10;
30
- sum += Math.pow(digit, power); // The digit raised to the power of the number of digits and added to the sum.
+ sum += (long) Math.pow(digit, power); // The digit raised to the power of the number of digits and added to the sum.
31
originalNumber /= 10;
32
}
33
0 commit comments