mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
fix: changed to std::pow
Co-authored-by: Krishna Vedala <7001608+kvedala@users.noreply.github.com>
This commit is contained in:
parent
06ca2a6953
commit
06f425493b
@ -43,7 +43,7 @@ bool is_armstrong(int number) {
|
|||||||
while (temp > 0) {
|
while (temp > 0) {
|
||||||
int rem = temp % 10;
|
int rem = temp % 10;
|
||||||
// Finding each digit raised to the power total digit and add it to the total sum
|
// 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;
|
temp = temp / 10;
|
||||||
}
|
}
|
||||||
return number == sum;
|
return number == sum;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user