SQR
From C64-Wiki
| BASIC keyword | |
| Keyword: | SQR |
| Abbreviation: | S, Shift+Q |
| Type: | Function |
| Token code: | 186/$BA |
| Handling routine in BASIC ROM: | 49009–49015 $BF71–BF77 |
| List of all BASIC keywords | |
Remark: This article describes the BASIC-Command SQR in BASIC V2 at the Commodore 64.
Typ: Numeric Function General Programming-Syntax: SQR(<Numeric>)
The numeric function SQR is a mathemathical function for square root of a number.
When the term isn't a number, the BASIC error ?TYPE MISMATCH ERROR IN line occurrs. It can be only used number with values from 0 until 1e+38. Then this area is out of range the BASIC error?OVERFLOW ERROR IN line is viewing. By negative values the BASIC error ?ILLEGAL QUANTITY ERROR IN line occurs. When the numeric argument is absent, it appears a ?SYNTAX ERROR IN line.
[edit] Examples
PRINT SQR(4) Screen: 2 PRINT SQR(15+10) Screen: 5
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