Saturday, July 9, 2022

๐Ÿ†• OCT$ Function

(Using the GW-BASIC User's Guide documentation for OCT$ as a template.)

Purpose:

To convert a decimal value to an octal value.

Syntax:

OCT$(x)

Comments:

  • Although GW-BASIC will round x to an integer before OCT$(x) is evaluated, BAM does not round the number, instead also coverting the numeric part after the point from decimal to octal too.
  • Octal numbers are numbers to the base 8 rather than base 10 (decimal numbers).


Examples:

PRINT OCT$(18)

Result: 22

(Decimal 18 equals octal 22.)

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...