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

        if($this->value < 0){
            return new S('-' . dechex(abs($this->value)));
        } else {
            return new S(dechex($this->value));
        }
    }
protected function _hex()
    {
        if(!$this->_decimal()->zero) {
            throw new \RuntimeException(
                'Cannot get hexadecimal numbers from non integer.'
            );
        }

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

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

Example:

$n = new N(2001);
echo $n->hex; // '7d1'

Negative numbers are allowed too:

$n = new N(-2001);
echo $n->hex; // '-7d1'


This is runtime part of its associated magic getter.

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