(no title)
cbarrick | 3 months ago
$ time cargo run --release
Finished `release` profile [optimized] target(s) in 0.02s
Running `target/release/p45`
0
1
40755
1533776805
57722156241751
2172315626468283465
cargo run --release 2.95s user 0.04s system 98% cpu 3.029 total
Runs on the Rust Playground too: https://play.rust-lang.org/?version=stable&mode=release&edit...
throwaway81523|3 months ago
wenderen|3 months ago
Rust newbie q - why use `x.wrapping_sub()` instead of regular old `x - 1`? Seems like we're never going to underflow `usize` for any of the 3 formulae?
throwaway81523|3 months ago
cbarrick|3 months ago
Because I coded it to start at x=0, which will underflow and will panic in debug mode.