PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
tores
Forum Contributor
Posts: 120 Joined: Fri Jun 18, 2004 3:04 am
Post
by tores » Wed Jul 20, 2005 11:04 am
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
shiznatix
DevNet Master
Posts: 2745 Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:
Post
by shiznatix » Wed Jul 20, 2005 11:08 am
id imagine that a integer can be as long as you want it to be. why would there be a restriction?
tores
Forum Contributor
Posts: 120 Joined: Fri Jun 18, 2004 3:04 am
Post
by tores » Wed Jul 20, 2005 11:09 am
At some point a number will go from int to double... When does this happen?
tores
Forum Contributor
Posts: 120 Joined: Fri Jun 18, 2004 3:04 am
Post
by tores » Wed Jul 20, 2005 11:19 am
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.