Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

finding the largest integer

Mon Oct 27, 2008 1:09 pm

Code:
<?
function maxint(){
  
$to_test = 2;
  while(
1){
     
$last = $to_test;
     
$to_test = 2 * $to_test;
     if ((
$to_test < $last) || (!is_int($to_test))){
         return(
$last + ($last - 1));
     }    
   }
}

$maxint = maxint();
print(
"Maxint is $maxint<BR>");
?>




Post a reply
  Related Posts  to : finding the largest integer
 Finding The Blinking Cursor     -  
 Finding a Substring Within a String in php     -  
 find the largest element stored in the array     -  
 Plug In to the Web at India's Largest Adobe Conference     -  
 integer value overflow     -  
 Invalid integer formats     -  
 Dividing two Integer values     -  
 Integer value compare with equal sign     -  
 handle integer overflows and underflows     -  
 rounding performed under integer division     -  

Topic Tags

PHP Variables