Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The result they are showing is clearly on a 64bit machine, my 32bit windows php overflows into a signed integer.

I posted initially with casting (int) $i but I tested it without and it worked too.

In fact on my 64bit centos machine PHP 5.4 doesn't need the cast at all and the original code gives the correct result the first time as is.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: