EXP

From C64-Wiki
Jump to: navigation, search
BASIC keyword
Keyword: EXP
Abbreviation: E Shift+X
Type: Function
Token code: 189/$BD
Handling routine
in BASIC ROM:
49133–57410
$BFED–E042
List of all BASIC keywords


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

Type: Numeric Function 
General Programming-Syntax: EXP(<Number>)

EXP is a mathemathical function that evaluates the inverse natural LOG of the argument. That is, the argument X is applied as an exponent to e(2.71828183). So EXP(X) = eX.

Arguments in excess of 89.0296919 result in the BASIC error ?OVERFLOW ERROR IN line. Arguments less than -89.0296919 evaluate to 0.

When the argument doesn't evaluate to a number, the BASIC error ?TYPE MISMATCH ERROR IN line occurs. When the numeric argument is absent, it displays a ?SYNTAX ERROR IN line.

Examples[edit]

PRINT EXP(0) Screen: 1
PRINT EXP(-1) Screen: 0.367879441
PRINT EXP(1) Screen: 2.71828183
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