一个简单的表达式有关问题

WBOY
Release: 2016-06-13 13:39:18
Original
784 people have browsed it

一个简单的表达式问题。
现在我需要将一句VC语句翻译为PHP语言。VC语句如下:

char ch1=103;
char ch2=ch1^131+5;
在VC里面算出来结果是-17

然后我把它翻译为PHP语言如下:

$ch1=103;
$ch2=($ch1^131)+5;
这样算出来的结果却是233.
该怎样写才可以让PHP算出来的结果也是-17呢?

------解决方案--------------------
$ch2=pow($ch1,131)+5;

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!