public function equal($num)
    {
        self::mustBeNumeric($num, 'Test of equality');

        if(is_object($num)){
            return $this->value == $num->value;
        } else {
            return $this->value == $num;
        }
    }
public function equal($num)
    {
        self::mustBeNumeric($num, 'Test of equality');

        if(is_object($num)){
            return $this->value == $num->value;
        } else {
            return $this->value == $num;
        }
    }
public function equal ( $ num ) { self :: mustBeNumeric ( $ num , 'Test of equality' ) ; if ( is_object ( $ num ) ) { return $ this -> value == $ num -> value ; } else { return $ this -> value == $ num ; } }
Checks if current number is equal to given argument.

This tests current number with given argument, an object or primitive
numeric value.

Example:

$n = new N(5);
var_dump($n->eq(5)); // true
var_dump($n->eq(5.0)); // true
var_dump($n->eq(new N(5))); // true
var_dump($n->eq(new N(5.0))); // true

@see N::notEqual() The opposite test.
@see N::eq() An alias
@throw \InvalidArgumentException If argument is not numeric or N class
@param  numeric|N   $num N or numeric value.
@return boolean
Checks if current number is equal to given argument .