HEX2BIN

Converts a hexadecimal number to its corresponding binary representation.

Syntax:

HEX2BIN( number {, places:Number} )

number may be a string of up to ten hexadecimal digits or a number of up to ten digits.

Two's complement representation is used: the highest (fortieth) bit is the sign bit of the hexadecimal number and the highest (tenth) bit is the sign bit of the binary result.

If specified, places must be in the range 1..10. If places is omitted, the minimum appropriate number of digits is returned.

Examples:

HEX2BIN("40", 8)

returns the text string "01000000".

HEX2BIN("1111111111")

returns the text string "1111111111".

Revisions:

This function was added in Fireworkz 2.24.