for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Samsara\Fermat\Provider\RoundingModeAdapters\Modes;
/**
*
*/
class HalfEvenAdapter extends BaseAdapter
{
* @inheritDoc
public function determineCarry(int $digit, int $nextDigit): int
$early = static::nonHalfEarlyReturn($digit);
$remainder = $this->remainderCheck();
if ($early == 0) {
return ($nextDigit % 2 == 0 && !$remainder) ? 0 : 1;
} else {
return $early == 1 ? 1 : 0;
}