bindec
Binary to decimal
&reftitle.description;
numberbindec
stringbinary_string
Returns the decimal equivalent of the binary number represented by
the binary_string argument.
bindec converts a binary number to an
integer or, if needed for size reasons, float.
bindec interprets all
binary_string values as unsigned
integers. This is because bindec sees
the most significant bit as another order of magnitude
rather than as the sign bit.
&reftitle.parameters;
binary_string
The binary string to convert
The parameter must be a string.
Using other data types will produce unexpected results.
&reftitle.returnvalues;
The decimal value of binary_string
&reftitle.examples;
bindec example
]]>
&example.outputs;
bindec interprets input as unsigned integers
]]>
&example.outputs.32bit;
&example.outputs.64bit;
&reftitle.notes;
The function can convert numbers that are too large to fit into the platforms
integer type, larger values are returned as float in
that case.
&reftitle.seealso;
decbin
octdec
hexdec
base_convert