PHP原码,反码,补码介绍_PHP教程

WBOY
Release: 2016-07-12 09:04:44
Original
1185 people have browsed it

PHP原码,反码,补码介绍

PHP原码,反码,补码介绍
 
原码:
    就是“原来的二进制码”,其实就是我们可以理解的按十进制转换为二进制之后得到的一个字符码。原码在数字上都是可以理解的。但在实际的计算机的运行过程中,却常常不用原码,所以就有反码,补码的问题。
在此基础上,规则:一个二进制数字的第一个位是符号位,0表示正数,1表示负数。
 
    举例:(都以8位为例):
        7:    00000111
       -7:    10000111
 
反码:
    正数的反码就是其本身。
    负数的反码就是将原码的非符号部分,每一位取反。。
    举例:
        7:    00000111
       -7:    11111000
 
补码:
    正数的补码是其本身
    负数的反码,符号位不变,其余每一位取反之后,整体加1
    举例:
        7:    00000111
       -7:    11111000+1 = 11111001
 

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/1071706.htmlTechArticlePHP原码,反码,补码介绍 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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!