Chapter 6 RAPID!
Functions
200 WCDMA Options Version 6.20
ABS
LOG, LGT
RND, RANDOMIZE
SGN Returns the sign of a numeric expression.
Syntax
ABS(numExp)
Parameters
numExp is a valid numeric expression.
Description
Returns the absolute value of
numExp.
If
numExp is an unassigned variable, a ‘0’ will be
returned.
Examples
t = ABS(-1)
Assigns ‘+1’ to variable t.
Syntax
LOG(numExp)
LGT(numExp)
Parameters
numExp is a valid numeric expression.
Description
LOG returns the natural logarithm of numExp while LGT
returns the common logarithm of
numExp.
Examples
i = LOG(1000)
j = LGT(1000)
Variable i will be set to ‘6.907755’ while j will be set to
‘3’.
Syntax
RND
RANDOMIZE(numExp)
Parameters
numExp is a valid numeric expression, interpreted as
positive integer.
Description
RND generates a random double floating-point number
between ‘0’ and ‘1’.
RANDOMIZE is used to reinitialize the random generator.
Note:
RANDOMIZE(x) will always lead to the same
sequence of random numbers.
Examples
The following example program reinitializes the random
generator and then prints ten random numbers.
RANDOMIZE 321
FOR i = 1 TO 10
PRINT RND
NEXT i