Convert any given dec/hex/oct number into a binary string. Can handle positive and negative values and works in that similar to the QB64 built-in HEX$ and OCT$ functions.
SYNTAX:
binary$ = Bin$ (value&&)
INPUTS:
value&& (_INTEGER64)
- The positive or negative number to convert.
- May also be given as &H or &O prefixed value.
- May also be floating point values, as long as its value fits into the _INTEGER64 input.
RESULT:
binary$ (STRING)
- The binary representation string of the given number.
- Just as long as needed, hence without leading zeros for positive values.
- Either 8/16/32 or 64 chars for negatives, depending on the input size.
NOTES:
- The possible range for floating point values is approximately -9.223372036854776E+18 to 9.223372036854776E+18.
- Different from HEX$ and OCT$, Bin$ won't throw an overflow error, if this range is exceeded, but the result is probably wrong in such a case.