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

๐Ÿ–ฅ 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...