(245)8 的八进制展开是多少啊(8是下标)

WBOY
Release: 2016-06-23 14:18:03
Original
2203 people have browsed it

如题。


为什么1和2结果不同

1

2*8^2 + 4*8^1 +5128+32+5结果:165
Copy after login



2
245 = 8*30 +530  = 8*3  +63   = 8*0  +3结果:365
Copy after login


回复讨论(解决方案)

代码2中,你把8进制数当做10进制数处理了
php 是这样表示 8 进制的

echo 0245; //165
Copy after login

php 是这样做数制转换的
echo base_convert('245', 8, 10);
Copy after login


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!