开发者

PHP: Why the 'abs' function returns a wrong number if it begins with zero?

开发者 https://www.devze.com 2022-12-27 06:45 出处:网络
The code \"abs(070000)\" returns 28672, but the code \"abs(70000)\" returns 70000. Did the zero at the beginning means that the number is interpreted as hex?

The code "abs(070000)" returns 28672, but the code "abs(70000)" returns 70000.

Did the zero at the beginning means that the number is interpreted as hex?

Tha开发者_StackOverflow中文版nk you!


Numbers beginning by zero are interpreted as octal.

See php documentation.

0

精彩评论

暂无评论...
验证码 换一张
取 消