private function getDecimal(array $number)
    {
        if ($this->isStandardBase($this->source->getDigitList())) {
            return gmp_init(implode('', $this->source->canonizeDigits($number)), $this->source->getRadix());
        }

        $number = $this->source->getValues($number);
        $decimal = gmp_init('0');
        $count = count($number);
        $radix = gmp_init($this->source->getRadix());

        for ($i = 0; $i < $count; $i++) {
            $decimal = gmp_add($decimal, gmp_mul(gmp_init($number[$i]), gmp_pow($radix, $count - $i - 1)));
        }

        return $decimal;
    }
private function getDecimal(array $number)
    {
        if ($this->isStandardBase($this->source->getDigitList())) {
            return gmp_init(implode('', $this->source->canonizeDigits($number)), $this->source->getRadix());
        }

        $number = $this->source->getValues($number);
        $decimal = gmp_init('0');
        $count = count($number);
        $radix = gmp_init($this->source->getRadix());

        for ($i = 0; $i < $count; $i++) {
            $decimal = gmp_add($decimal, gmp_mul(gmp_init($number[$i]), gmp_pow($radix, $count - $i - 1)));
        }

        return $decimal;
    }
private function getDecimal ( array $ number ) { if ( $ this -> isStandardBase ( $ this -> source -> getDigitList ( ) ) ) { return gmp_init ( implode ( '' , $ this -> source -> canonizeDigits ( $ number ) ) , $ this -> source -> getRadix ( ) ) ; } $ number = $ this -> source -> getValues ( $ number ) ; $ decimal = gmp_init ( '0' ) ; $ count = count ( $ number ) ; $ radix = gmp_init ( $ this -> source -> getRadix ( ) ) ; for ( $ i = 0 ; $ i < $ count ; $ i ++ ) { $ decimal = gmp_add ( $ decimal , gmp_mul ( gmp_init ( $ number [ $ i ] ) , gmp_pow ( $ radix , $ count - $ i - 1 ) ) ) ; } return $ decimal ; }
Converts the number from source base to a decimal GMP resource.
@param array $number Digits for the number to convert
@return resource resulting number as a GMP resource
Converts the number from source base to a decimal GMP resource .