|
Posted by "Brian P. O'Donnell" on 09/07/05 18:31
""Gustav Wiberg"" <gustav@varupiraten.se> wrote in message
news:024601c5b3be$77135140$0300a8c0@BLACKSHADOW...
>
> ----- Original Message -----
> From: "Shaw, Chris - Accenture" <cshaw@revenue.ie>
> To: "Gustav Wiberg" <gustav@varupiraten.se>; "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:gustav@varupiraten.se]
> >
>
> > 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)
?>
Navigation:
[Reply to this message]
|