Rust newbie: Algorithm performance question

The JavaScript mod (%) operator coerces its operand to a 32-bit integer. If you change your Rust code to use i32 instead of i64 then it will match the JS behavior and performance.

7 Likes