2 Comments
Aug 27, 2023Liked by Taras Tsugrii

Isn't your implementation UB? You cast after the addition? So you're casting the result, after the signed overflow (UB) would have already happened, no?

Expand full comment