! multiplication: this = this * ss2 it can return a carry */
| 395 | it can return a carry |
| 396 | */ |
| 397 | uint MulInt(sint ss2) |
| 398 | { |
| 399 | bool ss1_is_sign, ss2_is_sign; |
| 400 | uint c; |
| 401 | |
| 402 | ss1_is_sign = IsSign(); |
| 403 | |
| 404 | /* |
| 405 | we don't have to check the carry from Abs (values will be correct |
| 406 | because next we're using the method MulInt from the base class UInt |
| 407 | which is without a sign) |
| 408 | */ |
| 409 | Abs(); |
| 410 | |
| 411 | if( ss2 < 0 ) |
| 412 | { |
| 413 | ss2 = -ss2; |
| 414 | ss2_is_sign = true; |
| 415 | } |
| 416 | else |
| 417 | { |
| 418 | ss2_is_sign = false; |
| 419 | } |
| 420 | |
| 421 | c = UInt<value_size>::MulInt((uint)ss2); |
| 422 | c += CheckMinCarry(ss1_is_sign, ss2_is_sign); |
| 423 | |
| 424 | if( ss1_is_sign != ss2_is_sign ) |
| 425 | SetSign(); |
| 426 | |
| 427 | return c; |
| 428 | } |
| 429 | |
| 430 | |
| 431 |
no test coverage detected