mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-03 13:37:04 +00:00
In this patch we add to our expressions oper_t::SUB, for subtraction, analogous to the ADD from the previous patch. The only reason why we need a separate SUB operation and can't just combine ADD with a unary minus (NEG) operator is the minimum integer in fixed-sized integer. For example, 8-bit integers have the range -128...127. A subtraction like -1 - (-128) is valid (its value is 127) but the negation of (-128) would be invalid (128). One of the tests we add in this patch validates this fact. Signed-off-by: Nadav Har'El <nyh@scylladb.com>