Re: Integer - boundary?
| From: | M. Sokolewicz | Date: | Wed, 07 Sep 2005 15:47:23 +0000 |
| Subject: | Re: Integer - boundary? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-221972@lists.php.net to get a copy of this message | ||
Brian P. O'Donnell wrote:
""Gustav Wiberg"" <gustav@varupiraten.se> wrote in message news:024601c5b3be$77135140$0300a8c0@BLACKSHADOW...<?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----- 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?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:-----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?