! this method adds two value with a sign and returns a carry we're using methods from the base class because values are stored with U2 we must only make the carry correction this = p1(=this) + p2 when p1>=0 i p2>=0 carry is set when the highest bit of value is set when p1<0 i p2<0 carry is set when the highest bit of value is clear when p1>=0 i p2<0 carry will never be set wh
| 217 | when p1<0 i p2>=0 carry will never be set |
| 218 | */ |
| 219 | uint Add(const Int<value_size> & ss2) |
| 220 | { |
| 221 | bool p1_is_sign = IsSign(); |
| 222 | bool p2_is_sign = ss2.IsSign(); |
| 223 | |
| 224 | UInt<value_size>::Add(ss2); |
| 225 | |
| 226 | return CorrectCarryAfterAdding(p1_is_sign, p2_is_sign); |
| 227 | } |
| 228 | |
| 229 | |
| 230 | /*! |
no test coverage detected