includes/math.php
changeset 1380 0e400f946644
parent 1227 bdac73ed481e
equal deleted inserted replaced
1379:5cbd678df965 1380:0e400f946644
    27  	* @return resource
    27  	* @return resource
    28  	*/
    28  	*/
    29 	
    29 	
    30 	function init($int, $base = 10)
    30 	function init($int, $base = 10)
    31 	{
    31 	{
    32 		return ( is_resource($int) ) ? $int : gmp_init($int, $base);
    32 		return ( is_resource($int) || (is_object($int) && $int instanceof \GMP) ) ? $int : gmp_init($int, $base);
    33 	}
    33 	}
    34 	
    34 	
    35 	/**
    35 	/**
    36  	* Converts a number from a GMP integer to a string
    36  	* Converts a number from a GMP integer to a string
    37  	* @param resource
    37  	* @param resource