Unit tests for OP_DIV
Co-authored-by: Marcos Mayorga <mm@mm-studios.com>
Differential D1094
unit test for OP_DIV movrcx on Feb 15 2018, 00:54. Authored by
Details
Unit tests for OP_DIV Co-authored-by: Marcos Mayorga <mm@mm-studios.com> N/A
Diff Detail
Event TimelineComment Actions In C++ there is a corner-case where the maximal negative integer, divided by -1, overflows. Is there something similar in script? Comment Actions When the operands get loaded into CScriptNum they are allowed up to 4 bytes. They get allocated into an int64_t so there are no overflow issues. If the operation results in an overflow of the 4 bytes then the result gets pushed onto the stack but future arithmetic operations intentionally fail. CScriptNum bn2(stacktop(-1), fRequireMinimal); |