public function mod($mod)
    {
        self::mustBeNumeric($mod, 'Divisor');

        if ($mod instanceof N) {
            $mod = $mod->double;
        }

        if ($mod == 0) {
            throw new \InvalidArgumentException('Cannot divide by 0!');
        }

        return new N(fmod($this->value, $mod));
    }