Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- RLIB 3.0a Reference - <b>function:</b> bin2dec() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Function:    BIN2DEC()

Purpose:     Convert a binary number to its equivalent decimal value.

Syntax:      BIN2DEC( bin_str )

Arguments:   bin_str     - A character string representing the binary
                           number to convert to decimal value.

Returns:     The decimal value of the binary string parameter.

Description: BIN2DEC() converts a string that represents a binary number
             into its decimal equivalent.

Notes:       BIN2DEC() only converts positive numbers, there is no
             provision for determining the sign bit.  The <bin_str>
             parameter must be a valid binary string, i.e.  all characters
             must be either a zero or a one.  If a character is not a one
             ("1"), then BIN2DEC() will assume it to represent a zero in
             its parse calculation.

             If the required parameter is omitted, a zero will be returned
             and RLIBERROR() set.

Example:     bin_num = "11001101"
             dec_val = BIN2DEC(bin_num)
             ? dec_val                     && result = 205

Source:      RL_BIN2D.PRG

See also:    DEC2HEX(), HEX2DEC()

See Also: DEC2HEX() HEX2DEC()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson