decbin('1001') is prefered as decbin(1001).
Because on larger bit string, it may cause problem :
decbin(100000000000000) return 3
else
decbin('100000000000000') return 16384
![]() |
|
||||||||||
|
bindecDescriptionnumber bindec ( string binary_string )
Returns the decimal equivalent of the binary number represented by
the bindec() converts a binary number to an integer. The largest number that can be converted is 31 bits of 1's or 2147483647 in decimal. As of PHP 4.1.0, this function can also convert larger numbers. It returns float in that case.
See also decbin(), octdec(), hexdec() and base_convert(). bindec
26-Aug-2004 02:42
decbin('1001') is prefered as decbin(1001).
gwbdome at freenet dot de
19-Aug-2004 02:43
i think a better method than the "shift-method" is my method ^^...
martin at punix dot de
29-May-2003 10:47
## calculate binary with "shift-method" ##
juancri at tagnet dot org
30-Oct-2002 04:16
> The special reason 4 this is:
php at silisoftware dot com
28-Feb-2002 07:16
For converting larger-than-31-bit numbers:
da_he4datthe-gurusdotde
16-Sep-2001 07:11
[Editor's Note: |