Jump to content

Main public logs

Combined display of all available logs of JOHNWICK. You can narrow down the view by selecting a log type, the username (case-sensitive), or the affected page (also case-sensitive).

Logs
  • 00:13, 16 November 2025 PC talk contribs created page Rust“Wait… why is 2 ^ 10 equal to 8?” — Exponentiation in Rust (the right way) (Created page with "If you’ve ever typed this in Rust: assert_eq!(2 ^ 10, 8); …and felt your brain do a somersault, you’re not alone. In Rust, the caret ^ is not exponentiation — it’s bitwise XOR. That’s why 2 ^ 10 (binary 0b0010 ^ 0b1010) becomes 0b1000, a.k.a. 8. Clear? Great. Now let’s do actual exponentiation, idiomatically and safely. Rust’s ^ is the XOR operator, not power. See the language reference / operator table. The simplest way: .pow(...) on n...")