protected function decimalValue()
    {
        $base = $this->numberSystem->getBase();
        $result = 0;

        foreach (array_reverse($this->getDigits()) as $position => $value) {
            $numberSystemPosition = $this->numberSystem->getSymbolPosition($value);
            $result += $numberSystemPosition * pow($base, $position);
        }

        return $result;
    }
protected function decimalValue()
    {
        $base = $this->numberSystem->getBase();
        $result = 0;

        foreach (array_reverse($this->getDigits()) as $position => $value) {
            $numberSystemPosition = $this->numberSystem->getSymbolPosition($value);
            $result += $numberSystemPosition * pow($base, $position);
        }

        return $result;
    }
protected function decimalValue ( ) { $ base = $ this -> numberSystem -> getBase ( ) ; $ result = 0 ; foreach ( array_reverse ( $ this -> getDigits ( ) ) as $ position => $ value ) { $ numberSystemPosition = $ this -> numberSystem -> getSymbolPosition ( $ value ) ; $ result += $ numberSystemPosition * pow ( $ base , $ position ) ; } return $ result ; }
We use this to convert every number to decimal for calculations.
We use this to convert every number to decimal for calculations .