Fixed potential bug with -MINIMUM_VALUE #1
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "patch-1-negative-minimum-value"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original code had something like
N < 0 ? -N : N
which could fail ifN
has minimum value of appropriate type. For example, in original code this could fail:Also note that this code relies on "modulo on negative first operands" which was implementation defined in C++03 and before, but with C++11 and later it is defined by standard (see
ISO14882:2011(e)
), and this code anyway targets C++17 so we're safe here.