@param int $number
@param int $power

@return null|string
558391
protected function toWords($number, $power = 0)
    {
        $return = '';

        if ($number < 0) {
            $return = $this->minus . ' ';
            $number = (int) abs($number);
        }

        if ($number == 0 || $number == '') {
            return $this->wordSeparator . self::$digits[0];
        }

        $gt2000 = $number > 2000;

        if (strlen($number) > 3) {
            $maxp = strlen($number) - 1;
            $curp = $maxp;
            for ($p = $maxp; $p > 0; --$p) { // power
                if (isset(self::$exponent[$p])) {
                    // send substr from $curp to $p
                    $snum = substr($number, $maxp - $curp, $curp - $p + 1);
                    $snum = preg_replace('/^0+/', '', $snum);

                    if ($snum !== '') {
                        $return .= $this->toWords($snum, $p);

                        if ($gt2000) {
                            $return .= $this->thousandSeparator;
                        }
                    }
                    $curp = $p - 1;
                    continue;
                }
            }

            $number = substr($number, $maxp - $curp, $curp - $p + 1);

            if ($number == 0) {
                return rtrim($return, $this->thousandSeparator);
            }
        }

        $d = $number % 10;
        $t = (int) ($number / 10) % 10;
        $h = (int) ($number / 100) % 10;

        if ($h) {
            $return .= $this->wordSeparator . self::$digits[$h] . $this->wordSeparator . 'száz';
        }

        // ten, twenty etc.
        switch ($t) {
            case 9:
            case 5:
                $return .= $this->wordSeparator . self::$digits[$t] . 'ven';
                break;
            case 8:
            case 6:
                $return .= $this->wordSeparator . self::$digits[$t] . 'van';
                break;
            case 7:
                $return .= $this->wordSeparator . 'hetven';
                break;
            case 3:
                $return .= $this->wordSeparator . 'harminc';
                break;
            case 4:
                $return .= $this->wordSeparator . 'negyven';
                break;
            case 2:
                switch ($d) {
                    case 0:
                        $return .= $this->wordSeparator . 'húsz';
                        break;
                    case 1:
                    case 2:
                    case 3:
                    case 4:
                    case 5:
                    case 6:
                    case 7:
                    case 8:
                    case 9:
                        $return .= $this->wordSeparator . 'huszon';
                        break;
                }
                break;
            case 1:
                switch ($d) {
                    case 0:
                        $return .= $this->wordSeparator . 'tíz';
                        break;
                    case 1:
                    case 2:
                    case 3:
                    case 4:
                    case 5:
                    case 6:
                    case 7:
                    case 8:
                    case 9:
                        $return .= $this->wordSeparator . 'tizen';
                        break;
                }
                break;
        }

        if ($d > 0) {
            $return .= $this->wordSeparator . self::$digits[$d];
        }

        if ($power > 0) {
            if (isset(self::$exponent[$power])) {
                $lev = self::$exponent[$power];
            }

            if (!isset($lev) || !is_array($lev)) {
                return null;
            }

            $return .= $this->wordSeparator . $lev[0];
        }

        return $return;
    }
855385
public function inflectExponent($number, $power)
    {
        $singularPlural = $number % 10 === 1 ? 0 : 1;

        if ($power !== 1) {
            return ' ' . GermanDictionary::$exponent[$power][$singularPlural] . ' ';
        }

        return GermanDictionary::$exponent[$power][$singularPlural];
    }
141432
protected function _getEid($elapsed, $precision = 0.1)
    {
        $id = '';
        for ($level = 0; $level < 3; $level++) {
            /** @noinspection PowerOperatorCanBeUsedInspection */
            $current = $precision * pow(10, $level);
            if ($current >= 10) {
                break;
            }
            $count = min($elapsed / $current, 10);
            for ($i = 1; $i < $count; $i++) {
                $id .= 't' . (($current >= 1) ? $current * $i : substr(1 / $current, 1) . $i);
            }
        }

        return $id;
    }
698482
public function add($number = null)
    {
        if ($number == null) {
            $this->internalSetOperationModeWithHistory('add');
        } elseif ($number instanceof Closure) {
            $this->internalSetOperationModeWithHistory('add');
            return $this->group($number);
        } else {
            $this->performOperationOnExpressionEngine('add', $number);
        }
        return $this;
    }
733958
public function findByNumber($className, $number)
    {
        $extendee = trim($className, '\\');

        if ( ! isset($this->extensions[$extendee][$number])) {
            return null;
        }

        return $this->extensions[$extendee][$number];
    }
598959
@Override
    public Money scaleByPowerOfTen(int power) {
        return new Money(this.number.scaleByPowerOfTen(power), getCurrency(),
                monetaryContext);
    }
610353
public static function POWER($x = 0, $y = 2)
    {
        $x    = PHPExcel_Calculation_Functions::flattenSingleValue($x);
        $y    = PHPExcel_Calculation_Functions::flattenSingleValue($y);

        // Validate parameters
        if ($x == 0.0 && $y == 0.0) {
            return PHPExcel_Calculation_Functions::NaN();
        } elseif ($x == 0.0 && $y < 0.0) {
            return PHPExcel_Calculation_Functions::DIV0();
        }

        // Return
        $result = pow($x, $y);
        return (!is_nan($result) && !is_infinite($result)) ? $result : PHPExcel_Calculation_Functions::NaN();
    }
706938
private function createPointToUser($number = null)
    {
        return Point::create([
            'user_id' => $this->id,
            'rule_id' => $this->ruleId,
            'number' => $number
        ]);
    }
117531
private function getWordsBySplittingIntoTriplets($number)
    {
        $words = [];
        $triplets = $this->numberToTripletsConverter->convertToTriplets($number);

        foreach ($triplets as $i => $triplet) {
            if ($triplet > 0) {
                if (null !== $this->tripletTransformer) {
                    $words[] = $this->tripletTransformer->transformToWords($triplet);
                }

                if (null !== $this->powerAwareTripletTransformer) {
                    $words[] = $this->powerAwareTripletTransformer->transformToWords(
                        $triplet,
                        count($triplets) - $i - 1
                    );
                }

                if (null !== $this->exponentInflector) {
                    $words[] = $this->exponentInflector->inflectExponent($triplet, count($triplets) - $i - 1);
                }

                if (null !== $this->exponentGetter) {
                    $words[] = $this->exponentGetter->getExponent(count($triplets) - $i - 1);
                }
            }
        }

        return $words;
    }
333522
private function toBinary(string $number) : string
    {
        $result = '';

        while ($number !== '0') {
            [$number, $remainder] = $this->divQR($number, '256');
            $result .= \chr((int) $remainder);
        }

        return \strrev($result);
    }
1325655
protected static BigInteger getRadixPower(BigInteger radix, int power) {
		long key = (((long) radix.intValue()) << 32) | power;
		BigInteger result = radixPowerMap.get(key);
		if(result == null) {
			if(power == 1) {
				result = radix;
			} else if((power & 1) == 0) {
				BigInteger halfPower = getRadixPower(radix, power >> 1);
				result = halfPower.multiply(halfPower);
			} else {
				BigInteger halfPower = getRadixPower(radix, (power - 1) >> 1);
				result = halfPower.multiply(halfPower).multiply(radix);
			}
			radixPowerMap.put(key, result);
		}
		return result;
	}
1314576
protected function toWords($number, $power = 0)
    {
        $ret = '';

        if ($number < 0) {
            $ret .= $this->minus;
            $number *= -1;
        }

        if (strlen($number) > 3) {
            $maxp = strlen($number) - 1;
            $curp = $maxp;
            for ($p = $maxp; $p > 0; --$p) { // power

                // check for highest power
                if (isset(self::$exponent[$p])) {
                    // send substr from $curp to $p
                    $snum = substr($number, $maxp - $curp, $curp - $p + 1);
                    $snum = preg_replace('/^0+/', '', $snum);
                    if ($snum !== '') {
                        $cursuffix = self::$exponent[$power][count(self::$exponent[$power]) - 1];

                        $ret .= $this->toWords($snum, $p, $cursuffix);
                    }
                    $curp = $p - 1;
                    continue;
                }
            }
            $number = substr($number, $maxp - $curp, $curp - $p + 1);
            if ($number == 0) {
                return $ret;
            }
        } elseif ($number == 0 || $number == '') {
            return $this->wordSeparator . self::$digits[0];
        }

        $h = $t = $d = 0;

        switch (strlen($number)) {
            case 3:
                $h = (int) substr($number, -3, 1);

            case 2:
                $t = (int) substr($number, -2, 1);

            case 1:
                $d = (int) substr($number, -1, 1);
                break;

            case 0:
                return;
                break;
        }

        if ($h) {

            // inflection of the word "hundred"
            if ($h == 1) {
                $ret .= $this->wordSeparator . self::$hundreds[0];
            } elseif ($h == 2) {
                $ret .= $this->wordSeparator . "dvě" . $this->wordSeparator . self::$hundreds[1];
            } elseif (($h > 1) && ($h < 5)) {
                $ret .= $this->wordSeparator . self::$digits[$h] . $this->wordSeparator . self::$hundreds[2];
            } else {        //if ($h >= 5)
                $ret .= $this->wordSeparator . self::$digits[$h] . $this->wordSeparator . self::$hundreds[3];
            }
            // in English only - add ' and' for [1-9]01..[1-9]99
            // (also for 1001..1099, 10001..10099 but it is harder)
            // for now it is switched off, maybe some language purists
            // can force me to enable it, or to remove it completely
            // if (($t + $d) > 0)
            //   $ret .= $this->wordSeparator . 'and';
        }

        // ten, twenty etc.
        switch ($t) {
            case 2:
            case 3:
            case 4:
                $ret .= $this->wordSeparator . self::$digits[$t] . 'cet';
                break;

            case 5:
                $ret .= $this->wordSeparator . 'padesát';
                break;

            case 6:
                $ret .= $this->wordSeparator . 'šedesát';
                break;

            case 7:
                $ret .= $this->wordSeparator . 'sedmdesát';
                break;

            case 8:
                $ret .= $this->wordSeparator . 'osmdesát';
                break;

            case 9:
                $ret .= $this->wordSeparator . 'devádesát';
                break;

            case 1:
                switch ($d) {
                    case 0:
                        $ret .= $this->wordSeparator . 'deset';
                        break;

                    case 1:
                        $ret .= $this->wordSeparator . 'jedenáct';
                        break;

                    case 4:
                        $ret .= $this->wordSeparator . 'čtrnáct';
                        break;

                    case 5:
                        $ret .= $this->wordSeparator . 'patnáct';
                        break;

                    case 9:
                        $ret .= $this->wordSeparator . 'devatenáct';
                        break;

                    case 2:
                    case 3:
                    case 6:
                    case 7:
                    case 8:
                        $ret .= $this->wordSeparator . self::$digits[$d] . 'náct';
                        break;
                }
                break;
        }

        if (($t != 1) && ($d > 0) && (($power == 0) || ($number > 1))) {
            $ret .= $this->wordSeparator . self::$digits[$d];
        }

        if ($power > 0) {
            if (isset(self::$exponent[$power])) {
                $lev = self::$exponent[$power];
            }

            if (!isset($lev) || !is_array($lev)) {
                return null;
            }

            // inflection of exponental words
            if ($number == 1) {
                $idx = 0;
            } elseif ((($number > 1) && ($number < 5)) || ((intval("$t$d") > 1) && (intval("$t$d") < 5))) {
                $idx = 1;
            } else {
                $idx = 2;
            }

            $ret .= $this->wordSeparator . $lev[$idx];
        }

        return $ret;
    }
134336
public function Articles($number=null) {
		if (!$number) {
			$number = $this->numberToDisplay;
		}

		$start = isset($_REQUEST['start']) ? (int) $_REQUEST['start'] : 0;
		if ($start < 0) {
			$start = 0;
		}

		$articles = null;
		$filter = null;
		if ($this->PrimaryNewsSection) {
			// get all where the holder = me
			$filter = array('NewsSectionID' => $this->ID);
		} else {
			$subholders = $this->SubSections();
			if ($subholders) {
				$subholders->push($this);
			} else {
				$subholders = null;
			}

			if ($subholders && $subholders->Count()) {
				$ids = $subholders->column('ID');
				$filter = array('ParentID' => $ids);
			} else {
				$filter = array('ParentID' => (int) $this->ID);
			}
		}

		$orderBy = strlen($this->OrderBy) ? $this->OrderBy : 'OriginalPublishedDate';
		$dir = strlen($this->OrderDir) ? $this->OrderDir : 'DESC';
		if (!in_array($dir, array('ASC', 'DESC'))) {
			$dir = 'DESC';
		}

		$articles = NewsArticle::get()->filter($filter)->sort(array($orderBy => $dir))->limit($number, $start);
		$entries = PaginatedList::create($articles);
		$entries->setPaginationFromQuery($articles->dataQuery()->query());

		return $entries;
	}
983653
public function toTheN($number)
    {
        for ($i = 1; $i <= $number; $i++) {
            $this->multiply($this->number);
        }

        return $this;
    }
666885
public static function toJapaneseNumeral($number, $type = self::NUMERAL_KANJI)
    {
        // Return fast on zero
        if ($number == 0) {
            if ($type == self::NUMERAL_READING) {
                return 'zero';
            } else {
                return '〇';
            }
        }
        $separator = '';
        switch ($type) {
            case self::NUMERAL_KANJI:
                $mapPowersOfTen = self::$mapPowersOfTenKanji;
                $mapDigits = self::$mapDigitsKanji;
                break;
            case self::NUMERAL_KANJI_LEGAL:
                $mapPowersOfTen = self::$mapPowersOfTenKanjiLegal;
                $mapDigits = self::$mapDigitsKanjiLegal;
                break;
            case self::NUMERAL_READING:
                $mapPowersOfTen = self::$mapPowersOfTenReading;
                $mapDigits = self::$mapDigitsReading;
                $separator = ' ';
                break;
            default:
                throw new Exception('Unknown type');
        }
        $exponent = strlen($number) - 1;
        if ($exponent > 4) {
            $exponentRemainder = $exponent % 4;
            $closestExponent = $exponent - $exponentRemainder;
            $power = pow(10, $closestExponent);
            $remainder = bcmod($number, $power);
            $roundPart = $number - $remainder;
            $multiplier = (int)(($number - $remainder) / $power);
            if ($type != self::NUMERAL_READING || !self::getReadingException($roundPart)) {
                $result = self::toJapaneseNumeral($multiplier, $type) . $separator . $mapPowersOfTen[$closestExponent];
            } else {
                $result = self::getReadingException($roundPart);
            }
            if ($remainder != 0) {
                $result .= rtrim($separator . self::toJapaneseNumeral($remainder, $type));
            }
            return $result;
        } else {
            $result = '';
            while ($exponent > 0) {
                $power = pow(10, $exponent);
                $remainder = bcmod($number, $power);
                $roundPart = $number - $remainder;
                $multiplier = (int)(($number - $remainder) / $power);
                if ($type != self::NUMERAL_READING || !self::getReadingException($roundPart)) {
                    if ($multiplier != 1 || $exponent == 4) {
                        $result .= $mapDigits[$multiplier] . $separator;
                    }
                    $result .= $mapPowersOfTen[$exponent] . $separator;
                } else {
                    $result .= self::getReadingException($roundPart) . $separator;
                }
                $number = $remainder;
                $exponent = strlen($number) - 1;
            }
            if ($number != 0) {
                $result .= $mapDigits[$number];
            }
            return $result;
        }
    }
1208725
public function number($number = null)
    {
        if ($number !== null) {
            $this->number = $this->escape($number);
            return $this;
        }
        return $this->number;
    }
769991
public static function getCode($number, $output = 'name')
    {
        $code = '';
        $result = self::httpGet("http://www.kuaidi100.com/autonumber/auto?num={$number}");
        if (!empty($result)) {
            $name = @json_decode($result, true);
            $code = isset($name[0]['comCode']) ? $name[0]['comCode'] : '';
        }
        return $output == 'name' ? (isset(self::$data[$code]) ? self::$data[$code] : $code) : $code;
    }