diff --git a/src/main/java/com/thealgorithms/maths/Armstrong.java b/src/main/java/com/thealgorithms/maths/Armstrong.java index 526b31c3..ff4ae027 100644 --- a/src/main/java/com/thealgorithms/maths/Armstrong.java +++ b/src/main/java/com/thealgorithms/maths/Armstrong.java @@ -27,7 +27,7 @@ public class Armstrong { while (originalNumber > 0) { long digit = originalNumber % 10; - 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. originalNumber /= 10; }