Home > Backend Development > PHP Tutorial > PHP 按位取反的有关问题

PHP 按位取反的有关问题

WBOY
Release: 2016-06-13 13:13:54
Original
1007 people have browsed it

PHP 按位取反的问题
现在有一串数字,
$str=1300022332121
要求按位取反该怎么弄
这个按位取反,跟其他程序的按位取反,有不同之处吗
因为我是要能够将他传给C++写的程序的,
请各位大侠执教

------解决方案--------------------

PHP code
$str=1300022332121;
echo ~$str; //2147483647
<br><font color="#e78608">------解决方案--------------------</font><br>
没有那么简单<br><br>你的C++要求传入的是什么?<br><br>1300022332121 已经超出了 unsigned long 可表示的范围了 <div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
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