Home > php教程 > PHP源码 > body text

十进制数的次方

PHP中文网
Release: 2016-05-26 08:19:36
Original
1273 people have browsed it

十进制数是多少次方

<?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));
Copy after login
Related labels:
php
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template