public function mod(Decimal $d, int $scale = null): Decimal
    {
        $div = $this->div($d, 1)->floor();
        return $this->sub($div->mul($d), $scale);
    }
public function mod(Decimal $d, int $scale = null): Decimal
    {
        $div = $this->div($d, 1)->floor();
        return $this->sub($div->mul($d), $scale);
    }
public function mod ( Decimal $ d , int $ scale = null ) : Decimal { $ div = $ this -> div ( $ d , 1 ) -> floor ( ) ; return $ this -> sub ( $ div -> mul ( $ d ) , $ scale ) ; }
Calculate modulo with a decimal
@param Decimal $d
@param integer $scale
@return $this % $d
Calculate modulo with a decimal