Wednesday, November 16, 2022

🆕 _BIN$ and &O

 _BIN$

_BIN$ converts a decimal number resulting from the specified numerical expression into the binary equivalent.

Syntax

_BIN$ (numExpr)

return value: string that is the binary representation of the number.


&O

&O is a "numerical base prefix" for octal numbers.  This new prefix expands the already existing two other prefixes: &H for hexadecimal numbers and &B for binary numbers.  (All of these prefixes can be in either lowercase or uppercase.)

Examples for all of these numerical base prefixes:

  • Binary numbers: prefix with &b or &B
    • print &1010 prints the decimal number 10
    • print &b11111010prints the decimal number 250
  • Hex numbers: prefix with &h or &H
    • print &ha prints the decimal number 10
    • print &hfaprints the decimal number 250
  • Octal numbers: prefix with &o or &O
    • print &o12 prints the decimal number 10
    • print &o372prints the decimal number 250







No comments:

Post a Comment

🖥 Fan Dance

This is a port and mod of a SpecBAS program by ZXDunny. Run the program View the source code And, a "less is more?" version: Run t...