Conditions | 6 |
Paths | 8 |
Total Lines | 9 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 6.105 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | 20 | public function determineCarry(int $digit, int $nextDigit): int |
|
15 | { |
||
16 | 20 | $negative = $this->isNegative; |
|
17 | 20 | $remainder = $this->remainderCheck(); |
|
18 | |||
19 | 20 | if ($negative) { |
|
20 | 10 | return $digit > 4 ? 1 : 0; |
|
21 | } else { |
||
22 | 10 | return $digit > 5 || ($digit == 5 && $remainder) ? 1 : 0; |
|
23 | } |
||
25 | } |