LOG

From C64-Wiki
Jump to: navigation, search
BASIC keyword
Keyword: LOG
Abbreviation:
Type: Function
Token code: 188/$BC
Handling routine
in BASIC ROM:
47594–47655
$B9EA–BA27
List of all BASIC keywords


Remark: This article describes the BASIC-Command LOG in BASIC V2 at the Commodore 64.

Typ: Numeric Function 
General Programming-Syntax: LOG(<Numeric>)

The mathematical function LOG is a natural logarithm with the basis e(E). Is the term 0 or negative the BASIC error ?ILLEGAL QUANTITY ERROR IN line occur. When the number is over 1e+38 the BASIC-error ?OVERFLOW ERROR IN line appears. When the numeric argument is absent, it appears a ?SYNTAX ERROR IN line.

Examples[edit]

PRINT LOG(1) Result: 0
PRINT LOG(10) Result: 2.30258509
PRINT LOG(100)/LOG(10) Result: 2
                       because you can divided with  LOG(10),
                        LOG(100) and get a result with the basis "10". 


BASIC V2.0 (second release) Commands

ABS | AND | ASC | ATN | CHR$ | CLOSE | CLR | CMD | CONT | COS | DATA | DEF | DIM | END | EXP | FN | FOR | FRE | GET | GET# | GOSUB | GOTO | IF | INPUT | INPUT# | INT | LEFT$ | LEN | LET | LIST | LOAD | LOG | MID$ | NEW | NEXT | NOT | ON | OPEN | OR | PEEK | π  |POKE | POS | PRINT | PRINT# | READ | REM | RESTORE | RETURN | RIGHT$ | RND | RUN | SAVE | SGN | SIN | SPC | SQR | STATUS/ST | STEP | STOP | STR$ | SYS | TAB | TAN | THEN | TIME/TI | TIME$/TI$ | TO | USR | VAL | VERIFY | WAIT