Page 1 of 1
Max value for int
Posted: Wed Jul 20, 2005 11:04 am
by tores
Hi
What's the maximum value for an integer in PHP (WIN XP).
Is there a constant or function that returns this value?
regards tores
Posted: Wed Jul 20, 2005 11:08 am
by shiznatix
id imagine that a integer can be as long as you want it to be. why would there be a restriction?
Posted: Wed Jul 20, 2005 11:09 am
by tores
At some point a number will go from int to double... When does this happen?
Posted: Wed Jul 20, 2005 11:19 am
by tores
Code: Select all
define('MAXINT', 2147483647);
define('MININT', -2147483648);
An int spans from -2^31 ro 2^31-1. In php an int is made up from 32 bits where 1 bit is a sign bit.