note 79971 added to function.decbin
| From: | niek_dijkhuisathotmaildotcom at osu1 dot php dot net | Date: | Fri, 21 Dec 2007 13:55:29 +0000 |
| Subject: | note 79971 added to function.decbin | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-133848@lists.php.net to get a copy of this message | ||
I've also created a basic decbin function:
<?php
function dec2bin( $num )
{
$hex = $num * 2;
$bin = '';
while( $hex = floor( $hex / 2 ) ){
$bin .= $hex % 2;
if($hex == 1) {
break;
}
}
return strrev($bin);
}
?>
The native function is better; this one has no max
----
Server IP: 213.249.64.162
Probable Submitter: 82.75.108.196
----
Manual Page -- http://www.php.net/manual/en/function.decbin.php
Edit -- https://master.php.net/note/edit/79971
Del: integrated -- https://master.php.net/note/delete/79971/integrated
Del: useless -- https://master.php.net/note/delete/79971/useless
Del: bad code -- https://master.php.net/note/delete/79971/bad+code
Del: spam -- https://master.php.net/note/delete/79971/spam
Del: non-english -- https://master.php.net/note/delete/79971/non-english
Del: in docs -- https://master.php.net/note/delete/79971/in+docs
Del: other reasons-- https://master.php.net/note/delete/79971
Reject -- https://master.php.net/note/reject/79971
Search -- https://master.php.net/manage/user-notes.php