public function mod(Decimal $d, $scale = null) { $div = $this->div($d, 1)->floor(); return $this->sub($div->mul($d), $scale); }