~janbaudisch/euler-rs

413e67aa547c3d1aba2c09010e38ea9e6849525c — Jan Baudisch 5 years ago a579441
common: add palindrome and fix cast in factorial
1 files changed, 1 insertions(+), 2 deletions(-)

M common/src/math/factorial.rs
M common/src/math/factorial.rs => common/src/math/factorial.rs +1 -2
@@ 12,7 12,7 @@ macro_rules! impl_factorial {
                    0 | 1 => return 1,
                    2 => return 2,
                    _ => {
                        for n in 2..(self + 1) as u64 {
                        for n in 2..u64::from(self + 1) {
                            result *= n;
                        }
                    }


@@ 28,4 28,3 @@ impl_factorial!(u8);
impl_factorial!(u16);
impl_factorial!(u32);
impl_factorial!(u64);
impl_factorial!(u128);