Test for whole number.
| From: | Charlie Killian | Date: | Sun, 07 Apr 2002 23:10:46 +0000 |
| Subject: | Test for whole number. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-91961@lists.php.net to get a copy of this message | ||
Is there a one line test for whole numbers?
I want to condense this function down to one line:
function isOneBitSet($n)
{
$x = log($n)/log(2);
return ($x == intval($x));
}
TIA,
Charlie