Hacker News new | ask | show | jobs
by zozbot234 1717 days ago
Right, wrt. C++ the "square" operation on signed integers makes the whole program undefined if overflow occurs, whereas the Rust equivalent is defined to wrap using two's complement arithmetic. And of course the square of INT32_MIN cannot be represented in int32_t.