Home

Geeklog: What I Learnt Today / Adam

Division problems on 32bit OS

> I was happily doing some prime number detection until I came across some limits in my 32bit OSX 10.5

(7849431181 % 41) produces -1

which threw me then I read about it a little more if you want to tell if your php is running under 32bit OS try this:

echo PHP_INT_MAX; // I get 2147483647

If your 32bit you get:
2147483647
If your 64bit like dreamhost servers are you get
9223372036854775807

That really confused me.

/ Adam