mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-04-09 05:29:13 +08:00
fix: changed to std::pow
Co-authored-by: Krishna Vedala <7001608+kvedala@users.noreply.github.com>
This commit is contained in:
@@ -43,7 +43,7 @@ bool is_armstrong(int number) {
|
||||
while (temp > 0) {
|
||||
int rem = temp % 10;
|
||||
// Finding each digit raised to the power total digit and add it to the total sum
|
||||
sum = sum + pow(rem, total_digits);
|
||||
sum = sum + std::pow(rem, total_digits);
|
||||
temp = temp / 10;
|
||||
}
|
||||
return number == sum;
|
||||
|
||||
Reference in New Issue
Block a user