コード例 #1
0
ファイル: bigint.class.php プロジェクト: liuyu121/myqee
 protected static function _num2dec($num)
 {
     $n = count($num) << 1;
     $b = array();
     for ($i = 0; $i < $n; $i++) {
         $tmp = BigInt::div($num, array(10000), 1);
         $b[$i] = BigInt::zerofill($tmp[0], 4);
         $num = BigInt::div($num, array(10000));
     }
     while (count($b) > 1 && !(int) $b[count($b) - 1]) {
         array_pop($b);
     }
     $n = count($b) - 1;
     $b[$n] = (int) $b[$n];
     $b = join('', array_reverse($b));
     return $b;
 }