Home >php教程 >PHP源码 >十进制数的次方

十进制数的次方

PHP中文网
PHP中文网Original
2016-05-26 08:19:361308browse

十进制数是多少次方

<?php
//十进制转成2进制
$a =16384;
$i=0;
for(;;){
    $a = $a/2;
    var_dump($a);
    $i = $i+1;
    var_dump($i);
    if($a==1){
        echo $i;
        break;
    }
}
//2进制转成十进制
var_dump(pow(2,7));
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn