
7-6
Section
Details of BASIC Commands
144
cdbl
Syntax:
CDBL
(<numerical expression>)
Description:
Function. Converts the <numerical expression> into a double-precision floating point.
Remarks:
<numerical expression> may be any integer, single-precision floating point or double-precision
floating-point expression.
If the <numerical expression> is an integer or single-precision floating-point integer, then
CDBL
will convert it to a double-precision floating-point integer. If the <numerical expression> is
already a double-precision floating-point integer, then the precision of the returned value will be
the same as it was before conversion.
Even after conversion to a double-precision floating-point integer, only the digits for single
precision may sometimes be shown. The number, however, will have the number of digits
required for double precision.
If the number contains consecutive zeros, only the digits for single precision may sometimes be
output, as described above.
Examples:
> 10 A# = CDBL(22)/CDBL(7)
> 20 B# = 22!/7!
> 30 PRINT A#, B#
> RUN
3.14285714285714
3.14286
See also:
CINT
,
CSNG
chr$
Syntax:
CHR
$ (<numerical expression>)
Description:
Function. Converts the <numerical expression> into a character.
<numerical expression> may be any integer in the range: [0…255]. Non-integer numerical
expressions are rounded to the nearest integer. The decimal equivalent of the ASCII character
code is used and converted to the corresponding character.
Remarks:
Note:
1.
If the integer expression lies out with the specified range an “Illegal Function call”
(code B005) or “Overflow” (code B006) error will result.
2.
The ASC function is the opposite of CHR$.
3.
As an example of the rounding function,
CHR
$(67.4) returns ‘C’ and
CHR
$(67.5)
returns ‘D’.
Examples:
> 10 A$ = CHR$(67)
> 20 PRINT A$
> RUN
C
See also:
ASC
Содержание C200H-ASC11
Страница 1: ...C200H ASC11 ASC21 ASC31 ASCII Units Operation Manual Revised June 2000...
Страница 2: ...iv...
Страница 4: ...vi...