Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What formats of binary numbers are supported?

0
10 Posted

What formats of binary numbers are supported?

0

REBOL actually supports binary STRINGS. Of them, Base-2 (binary), base-16 (hexadecimal), and base-64 strings are possible. You can convert these strings to integers, for instance: 10 = to-integer 64#{AAAK} = to-integer 16#{0A} = to-integer 2#{0000 1010} You can turn an integer into a hexadecimal string with the TO-HEX function. Integer (base-10) to binary is currently supported up to 32-bit signed numbers. The range is from -2147483647 to +2147483647. Hex binaries must have an even number of digits, base-64 must have a multiple of 4 digits and base-2 must have a multiple of 8 digits. The binary datatype was included to assist in working with compressed data, image data (such as JPEGs), executables, etc. The default binary output format can be set in system/options/binary-base. Valid values are 2 (binary), 16 (hexadecimal) and 64 (base-64).

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123