diff options
| author | Luke Dashjr <[email protected]> | 2012-06-18 20:35:10 +0000 |
|---|---|---|
| committer | Luke Dashjr <[email protected]> | 2012-06-18 20:37:57 +0000 |
| commit | 0f5a2a82d93f55e1f5ad1c5401b8b5ceeb38b0df (patch) | |
| tree | 5c976160f2611e2d5dfdb33c3e5c76d5865643e0 /src/util.cpp | |
| parent | Fix signed subtraction overflow in CBigNum::setint64(). (diff) | |
| download | discoin-0f5a2a82d93f55e1f5ad1c5401b8b5ceeb38b0df.tar.xz discoin-0f5a2a82d93f55e1f5ad1c5401b8b5ceeb38b0df.zip | |
CBigNum: Convert negative int64 values in a more well-defined way
Since the minimum signed integer cannot be represented as positive so long as its type is signed, and it's not well-defined what happens if you make it unsigned before negating it, we instead increment the negative integer by 1, convert it, then increment the (now positive) unsigned integer by 1 to compensate
Diffstat (limited to 'src/util.cpp')
0 files changed, 0 insertions, 0 deletions