本文整理汇总了PHP中Math::pow方法的典型用法代码示例。如果您正苦于以下问题:PHP Math::pow方法的具体用法?PHP Math::pow怎么用?PHP Math::pow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Math
的用法示例。
在下文中一共展示了Math::pow方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: alignCore2
//.........这里部分代码省略.........
$mem->set($key, 1);
$ct++;
}
unset($key, $j1);
}
unset($_g21);
$_g22 = 0;
while ($_g22 < $hb) {
$j2 = $_g22++;
$key1 = $av->toString($b->getCell($cb, $j2));
if (!$mem2->exists($key1)) {
$mem2->set($key1, 1);
$ct++;
}
unset($key1, $j2);
}
unset($_g22);
$columns_eval->push(new _hx_array(array($i, $ct)));
unset($mem2, $mem, $i, $ct, $cb, $ca);
}
$sorter = array(new _hx_lambda(array(&$N, &$a, &$align, &$av, &$b, &$column_order, &$columns, &$columns_eval, &$common_units, &$ha, &$hb, &$ids, &$ignore, &$index_top, &$pending_ct, &$ra_header, &$rb_header, &$reverse_pending_ct, &$used, &$used_reverse, &$w), "coopy_CompareTable_0"), 'execute');
$columns_eval->sort($sorter);
$columns = Lambda::harray(Lambda::map($columns_eval, array(new _hx_lambda(array(&$N, &$a, &$align, &$av, &$b, &$column_order, &$columns, &$columns_eval, &$common_units, &$ha, &$hb, &$ids, &$ignore, &$index_top, &$pending_ct, &$ra_header, &$rb_header, &$reverse_pending_ct, &$sorter, &$used, &$used_reverse, &$w), "coopy_CompareTable_1"), 'execute')));
$columns = $columns->slice(0, $N);
} else {
$_g12 = 0;
$_g6 = $common_units->length;
while ($_g12 < $_g6) {
$i1 = $_g12++;
$columns->push($i1);
unset($i1);
}
}
$top = Math::round(Math::pow(2, $columns->length));
$pending = new haxe_ds_IntMap();
$_g7 = 0;
while ($_g7 < $ha) {
$j3 = $_g7++;
$pending->set($j3, $j3);
unset($j3);
}
$added_columns = new haxe_ds_IntMap();
$index_ct = 0;
$_g8 = 0;
while ($_g8 < $top) {
$k = $_g8++;
if ($k === 0) {
continue;
}
if ($pending_ct === 0) {
break;
}
$active_columns = new _hx_array(array());
$kk = $k;
$at = 0;
while ($kk > 0) {
if (_hx_mod($kk, 2) === 1) {
$active_columns->push($columns[$at]);
}
$kk >>= 1;
$at++;
}
$index = new coopy_IndexPair($this->comp->compare_flags);
$_g23 = 0;
$_g13 = $active_columns->length;
while ($_g23 < $_g13) {
示例2: quadEquation
/**
* @param int $a
* @param int $b
* @param int $c
* @param int $x
* @return int
*/
public static function quadEquation($a, $b, $c, $x)
{
return $a * Math::pow($x, 2) + $b * $x + $c;
}
示例3: array
$arr = array('fdjiefwf', '123');
Funt::map($arr, function ($k, $v) {
echo "{$k} -> {$v} \n";
});
Funt::map($arr, lambda('$k, $v -> print "$k ==> $v \\n"'));
$str = "abcdefg";
Funt::map($str, function ($ch) {
echo "{$ch} \n";
});
$arr = array(1, 2, 3, 4, 5);
echo Funt::reduce(function ($r, $k, $v) {
return $r + $v;
}, 1, $arr) . "\n";
echo Math::add(1, 2, 3, 4, 5, 6) . "\n";
echo Math::mul(1, 2, 3, 4, 5, 6) . "\n";
echo Math::pow(2, 3, 2) . "\n";
echo 2 ** 3 ** 2 . "\n";
function abc()
{
}
var_dump('abc') . "\n";
// PHP不支持“惰性特征”
// $arr = array(1/0, 3, 4);
// var_dump(count($arr));
// PHP的闭包“惰性特征”
$arr = function () {
return array(1 / 0);
};
// 使用PHP的yeild协同机制,可以实现类似nodejs的事件机制。
/*
函数式编程通用方法语义说明: