public function times($callback)
    {
        self::mustBeCallable($callback);

        if(!$this->_decimal()->zero) {
            throw new \RuntimeException(
                'Cannot iterate given callback when number is not integer.'
            );
        }

        if($this->value == 0){
            throw new \RuntimeException(
                'Cannot iterate given callback on a void range.'
            );
        }

        if($this->value > 0){
            $arr_range = range(0, $this->value - 1);
        } else {
            $arr_range = range($this->value + 1, 0);
        }

        $a = new A();

        foreach($arr_range as $idx){
            $idx = new N($idx);
            $a->add($callback($idx));
        }

        return $a;
    }
public function times($callback)
    {
        self::mustBeCallable($callback);

        if(!$this->_decimal()->zero) {
            throw new \RuntimeException(
                'Cannot iterate given callback when number is not integer.'
            );
        }

        if($this->value == 0){
            throw new \RuntimeException(
                'Cannot iterate given callback on a void range.'
            );
        }

        if($this->value > 0){
            $arr_range = range(0, $this->value - 1);
        } else {
            $arr_range = range($this->value + 1, 0);
        }

        $a = new A();

        foreach($arr_range as $idx){
            $idx = new N($idx);
            $a->add($callback($idx));
        }

        return $a;
    }
public function times ( $ callback ) { self :: mustBeCallable ( $ callback ) ; if ( ! $ this -> _decimal ( ) -> zero ) { throw new \ RuntimeException ( 'Cannot iterate given callback when number is not integer.' ) ; } if ( $ this -> value == 0 ) { throw new \ RuntimeException ( 'Cannot iterate given callback on a void range.' ) ; } if ( $ this -> value > 0 ) { $ arr_range = range ( 0 , $ this -> value - 1 ) ; } else { $ arr_range = range ( $ this -> value + 1 , 0 ) ; } $ a = new A ( ) ; foreach ( $ arr_range as $ idx ) { $ idx = new N ( $ idx ) ; $ a -> add ( $ callback ( $ idx ) ) ; } return $ a ; }
Repeats given callable param.

Runs N times given callable param. N is current number.

As argument, callable params as current index of iteration as
`\Malenki\Bah\N` object.

If callable param returns content, then each returned result is stored
into an `\Malenki\Bah\A` object.

Example:

$n = new N(7);

$func = function($i){
if($i->odd){
return true;
}

return false;
};

var_dump($n->times($func)->array); // array(false, true, false, true, false, true, false)

__Note:__ Current number can be negative, but cannot be zero

@param mixed $callback A callable action
@return N
@throws \InvalidArgumentException If param is not callable
@throws \RuntimeException If number is not an integer
@throws \RuntimeException If number is zero
Repeats given callable param .