! multiplication this = this * ss2 it returns carry if the result is too big (we're using the method from the base class but we have to make one correction in account of signs) */
| 437 | one correction in account of signs) |
| 438 | */ |
| 439 | uint Mul(Int<value_size> ss2) |
| 440 | { |
| 441 | bool ss1_is_sign, ss2_is_sign; |
| 442 | uint c; |
| 443 | |
| 444 | ss1_is_sign = IsSign(); |
| 445 | ss2_is_sign = ss2.IsSign(); |
| 446 | |
| 447 | /* |
| 448 | we don't have to check the carry from Abs (values will be correct |
| 449 | because next we're using the method Mul from the base class UInt |
| 450 | which is without a sign) |
| 451 | */ |
| 452 | Abs(); |
| 453 | ss2.Abs(); |
| 454 | |
| 455 | c = UInt<value_size>::Mul(ss2); |
| 456 | c += CheckMinCarry(ss1_is_sign, ss2_is_sign); |
| 457 | |
| 458 | if( ss1_is_sign != ss2_is_sign ) |
| 459 | SetSign(); |
| 460 | |
| 461 | return c; |
| 462 | } |
| 463 | |
| 464 | |
| 465 | /*! |
no test coverage detected