0x00000050 Computer blue Screen code PHP take the remainder function code

Source: Internet
Author: User
Copy the Code code as follows:


The value to be taken into the system position
function Getremainder ($num, $bin, $pos, & $result = 0) {
Author Lianq.net
$num Value, Decimal
$bin the binary to convert
Number of $pos digits
$real _len = log ($num, $bin);//logarithm, calculate the length of the original value
$floor _len = Floor ($real _len);//to seek the whole
$base = Pow ($bin, $pos-1);//Cardinality
$divisor = Pow ($bin, $pos);//divisor
if ($num >= $divisor) {
$new _num = $num% pow ($bin, $floor _len);
Getremainder ($new _num, $bin, $pos, $result);
}else{
$result = Floor ($num/$base);
}
return $result;
}
For example, when the value 16 is converted to 9, what is the value on the first bit?
$a = Getremainder (16,9, 1);
echo $a;//Output 7

The above describes the 0x00000050 computer blue screen code PHP to take the remainder function code, including the 0x00000050 computer blue screen code content, I hope that the PHP tutorial interested friends helpful.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.