Returns the result of a number raised to a power
340076
public static BigDecimal power(EvaluationContext ctx, Object number, Object power) {
        BigDecimal _number = Conversions.toDecimal(number, ctx);
        BigDecimal _power = Conversions.toDecimal(power, ctx);
        return ExpressionUtils.decimalPow(_number, _power);
    }
1226363
def number(self):
        """"""
        number = ''
        while self.char is not None and self.char.isdigit():
            number += self.char
            self.advance()

        if self.char == '.':
            number += self.char
            self.advance()

            while self.char is not None and self.char.isdigit():
                number += self.char
                self.advance()

            token = Token(Nature.FLOAT_NUMBER, number)

        else:
            token = Token(Nature.INT_NUMBER, number)

        return token
590091
def number(v):
    """"""
    if nodesetp(v):
        v = string(v)
    try:
        return float(v)
    except ValueError:
        return float('NaN')
1227144
function(number, precision) {

    const multiplier = !!precision ? Math.pow(10, precision) : 1;

    return Math.floor(number * multiplier) / multiplier;
  }
1366768
function multiplyByNumber(num, x, base) {
  if (num < 0) return null;
  if (num == 0) return [];
  var result = [];
  var power = x;

  while (true) {
    if (num & 1) {
      result = add(result, power, base);
    }

    num = num >> 1;
    if (num === 0) break;
    power = add(power, power, base);
  }

  return result;
}
1179597
def next_power_of_2(n):
    
    n -= 1  # greater than OR EQUAL TO n
    shift = 1
    while (n + 1) & n:  # n+1 is not a power of 2 yet
        n |= n >> shift
        shift *= 2
    return max(4, n + 1)
115277
def _convert_number(self, number):
        """"""

        number = float(number)
        return int(number) if number.is_integer() else float(number)
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;
    }
470969
def t_NUMBER(self, t):
        '
        try:
            sv = t.value
            v = float(sv)
            iv = int(v)
            t.value = (iv if iv == v else v, sv)
        except ValueError:
            print("Number %s is too large!" % t.value)
            t.value = 0
        return t
902797
def ceilpow2(n):
    """"""
    signif,exponent = frexp(n)
    if (signif < 0):
        return 1;
    if (signif == 0.5):
        exponent -= 1;
    return (1) << exponent;
669939
def real_value(value, digit):
    
    return str(float(value) / math.pow(10, float(digit)))
844345
def pow(self, *args, **kwargs):
        
        return self._apply(operator.pow, *args, **kwargs)
1001477
def num(value):
    """"""
    if re_hex_num.match(value):
        return int(value, base=16)
    else:
        return int(value)
646210
@Inline(value="$1.pow($2)")
	@Pure
	public static BigInteger operator_power(BigInteger a, int exponent) {
		return a.pow(exponent);
	}
1025017
def power_level(self, val):
        """"""
        if val in [0, 1, 2, 3]:
            self.pdx.PowerLevel = val
        elif type(val) is str:
            if val.lower() == "high":
                self.pdx.PowerLevel = 0
            elif val.lower() == "highlow":
                self.pdx.PowerLevel = 1
            elif val.lower() == "lowhigh":
                self.pdx.PowerLevel = 2
            elif val.lower() == "low":
                self.pdx.PowerLevel = 3
        else:
            raise ValueError("Not a valid power level")
1205757
def t_NUMBER(t):
    '
    exponents = {
            'G' : 30, 'g' : 30,
            'M' : 20, 'm' : 20,
            'K' : 10, 'k' : 10,
            }
    if t.value[-1] in exponents:
        t.value = math.ldexp(int(t.value[:-1]), exponents[t.value[-1]])
    else:
        t.value = int(t.value)
    return t
536848
function(number) 
  {
    var bcd = ((number/10)<<4) + (number%10);
    var retVal = bcd.toString(16);
    if( retVal.length < 2 ){
      retVal = '0' + retVal;
    }
    return retVal;
  }