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

🖥 Flower Tesselation: Testing DRAW and recursive SUB's

This BAM program inspired by Richard Russell's "Flower-like tesselation" BBC BASIC program posted on Facebook . Created in ord...