note 86704 deleted from language.types.integer by googleguy
| From: | googleguy@php.net | Date: | Fri, 11 Jan 2013 09:31:03 +0000 |
| Subject: | note 86704 deleted from language.types.integer by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-192915@lists.php.net to get a copy of this message | ||
Note Submitter: Giovanni
----
why not just using logarithms?
$num_of_digits = (int)(log($num,$base) +1);
I think this should be more performant (as it relies on the math coprocessor) and it could be
extended to number of digits representing the number in any base, not just decimal