Cleanup armstrong
This commit is contained in:
parent
44021cacdf
commit
c3316e6ad9
1 changed files with 1 additions and 2 deletions
|
@ -6,8 +6,7 @@ pub fn is_armstrong_number(num: u32) -> bool {
|
|||
let divisor = 10u32.pow(i);
|
||||
let quotient = num / divisor;
|
||||
let digit = quotient % 10;
|
||||
let raised = digit.pow(count);
|
||||
raised
|
||||
digit.pow(count)
|
||||
}).sum();
|
||||
num == armstrong_sum
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue