! this method subtracts two values with a sign we don't use the previous Add because the method ChangeSign can sometimes return carry this = p1(=this) - p2 when p1>=0 i p2>=0 carry will never be set when p1<0 i p2<0 carry will never be set 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 cle
| 296 | when p1<0 i p2>=0 carry is set when the highest bit of value is clear |
| 297 | */ |
| 298 | uint Sub(const Int<value_size> & ss2) |
| 299 | { |
| 300 | bool p1_is_sign = IsSign(); |
| 301 | bool p2_is_sign = ss2.IsSign(); |
| 302 | |
| 303 | UInt<value_size>::Sub(ss2); |
| 304 | |
| 305 | return CorrectCarryAfterSubtracting(p1_is_sign, p2_is_sign); |
| 306 | } |
| 307 | |
| 308 | |
| 309 | /*! |
no test coverage detected