pmtolk Posted June 5, 2008 Share Posted June 5, 2008 B"H I am using the math mod operator % when I enter the following code $result=1234567891 % 100000000 I get the correct result 34567891 but if I do it by 1 more digit $result=12345678912 % 100000000 -39222976 which doesn't make any sense 12,345,678,912 12 billion should fit into a c type long which is was what I thought the default size of an integer is in php What am I missing? Thanks so much Philip Quote Link to comment Share on other sites More sharing options...
btherl Posted June 5, 2008 Share Posted June 5, 2008 The underlying type of an integer in php is an int. That is 32 bits on a 32 bit OS, and 64 bits on a 64 bit OS (with a 64 bit version of php). There's a table of limits here: http://en.wikipedia.org/wiki/Limits.h Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.