Closed philmb3487 closed 4 years ago
However this is undefined behaviour under certain circumstances: https://stackoverflow.com/questions/17313579/is-there-a-safe-way-to-get-the-unsigned-absolute-value->
A relevant example can be found at : https://godbolt.org/z/yRwtCG
This was first reported in: bitcoin/bitcoin#18046
utACK. It looks clean using static casts, thanks for that!
However this is undefined behaviour under certain circumstances: https://stackoverflow.com/questions/17313579/is-there-a-safe-way-to-get-the-unsigned-absolute-value->
A relevant example can be found at : https://godbolt.org/z/yRwtCG
This was first reported in: bitcoin/bitcoin#18046