Run Mode; Functions - Sharp PC-1403 Operation Manual

Hide thumbs Also See for PC-1403:
Table of Contents

Advertisement

90
You must
use
parentheses for
functions
which
have
more
than
one argument.
Using
parentheses always makes programs
clearer.
See Chapter 8
for
a complete list
of
functions available
on
the
computer.
ABS
(-5)
is
5
ABS
(6)
is 6
LOG
is
a function which
computes the
log to
the base
10
of
its
argument.
LOG (100)
is
2
LOG
(1000) is 3
A
function can
be used
any place that
a variable can
be
used.
Many functions do
not
require the
use of
parentheses:
LOG
100 is the
same
as LOG (100)
Functions
are special components of
the
BASIC language which take one
value
and
transform it into another
value. Functions act
like
variables
whose value is determined
by the
val
u e of other
variables
or
expressions.
ABS
is
a function which
produces
the
absolute value
of its
argument:
Functions
The
1
means
that
the
expression
is True.
1
.
(5>3)
AND
(2<6)
Display
Input
In
general,
any of the above
expressions
can
be used in
the
RUN
mode
well
as
i
n
programming
a BASIC
statement. In
the
RUN mode
an expression
is
computed and
displayed
immediately.
For example:
RUN Mode
5
+
(2
*
3)
or
(5
+
2)
*
3
The
exact
rules
of "operator
precedence"
are given in
Appendix D.
To avoid having to
remember
all
these rules
and to make your program
clearer, always
use
parentheses to
determine
the sequence
of
evaluation.
The
above example
is
clarifi
e d
by writing
either:
2*3=6
6+5=11
or
5
+
2
*
3
cou
Id
be
5+2=7
7
*
3
=
21
Concepts and Terms of BASIC

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents