Brian P. O'Donnell wrote:
""Gustav Wiberg"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

----- Original Message -----
From: "Shaw, Chris - Accenture" <[EMAIL PROTECTED]>
To: "Gustav Wiberg" <[EMAIL PROTECTED]>; "PHP General"
<php-general@lists.php.net>
Sent: Wednesday, September 07, 2005 5:03 PM
Subject: RE: [PHP] Integer - boundary?




-----Original Message-----
From: Gustav Wiberg [mailto:[EMAIL PROTECTED]


Hi there!


What is the boundary for an integer?


seems to be a easy question, but I can't find it...

/G
http://www.varupiraten.se/



According to the manual,


"The size of an integer is platform-dependent, although a maximum value of
about two billion is the usual value (that's 32 bits signed). PHP does not
support unsigned integers."



************************

This message has been delivered to the Internet by the Revenue Internet
e-mail service

*************************


--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.10.18/91 - Release Date: 2005-09-06

Hi there!

Thanx!

Hm... I would rephrase my question.. Is it possible to get the maximum
integer-value that can be used?


Hi

Try this code to see what it is on your platform:

Brian

<?

// start with some number you are sure is an integer
// make it a really high number to lessen the execution time
$i = 2100000000;

// if you want to do it on the first try, allow it to run until finished
// it will almost certainly take more than 30 seconds
set_time_limit(0);

while(is_int($i))
{
$i++;
}

// then you have the first number that doesn't qualify as int (on your
platform)
print($i)

?>
or, easier, simply make this script:
<?php
echo PHP_INT_MAX;
?>

and you're done :P The maximum integer value is stored in PHP_INT_MAX as of 4.4.0 and PHP 5.0.5

before that, you had to use a way as the one Brian posted

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to