protected function _bin()
    {
        if(!$this->_decimal()->zero) {
            throw new \RuntimeException(
                'Cannot get binary numbers from non integer.'
            );
        }

        if($this->value < 0){
            return new S('-'.decbin(abs($this->value)));
        } else {
            return new S(decbin($this->value));
        }

    }
protected function _bin()
    {
        if(!$this->_decimal()->zero) {
            throw new \RuntimeException(
                'Cannot get binary numbers from non integer.'
            );
        }

        if($this->value < 0){
            return new S('-'.decbin(abs($this->value)));
        } else {
            return new S(decbin($this->value));
        }

    }
protected function _bin ( ) { if ( ! $ this -> _decimal ( ) -> zero ) { throw new \ RuntimeException ( 'Cannot get binary numbers from non integer.' ) ; } if ( $ this -> value < 0 ) { return new S ( '-' . decbin ( abs ( $ this -> value ) ) ) ; } else { return new S ( decbin ( $ this -> value ) ) ; } }
Converts to binary number.

Returns current integer number converted to binary as `\Malenki\Bah\S`
object.

Example:

$n = new N(2001);
echo $n->bin; // '11111010001'

Negative numbers are allowed too:

$n = new N(-2001);
echo $n->bin; // '-11111010001'


This is runtime part of its associated magic getter.

@see N::$bin Magic getter `N::$bin`
@see N::_b() Alias
@return S
@throws \RuntimeException If current number is not an integer.
Converts to binary number .