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