
GeoB
ASIC
Reference Manual
5.Standard Functions
TPS1100-Version 1.30
5-23
DIM dDegrees AS Double
' Declare variables.
DIM dRadians AS Double
dDegrees = 45.0
dRadians = dDegrees * (Pi / 180) ' Convert to
'
radians.
Write( "The tangent of a " + Str$(dDegrees) +
" degree angle is " +
Str$( Tan(dRadians)) )
5.5.10 Rnd Function
Description
Returns a random number in a user-defined value-range.
Declaration
Rnd( dNumber AS Double
) AS Double
Rnd( iNumber AS Integer ) AS Integer
Remarks
The
argument
dNumber
can be any valid numeric expression.
The
Rnd
function returns a pseudo random value in the range 0 to
dNumber
. The
SRnd
function can be used to seed the pseudo
random number generator before calling
Rnd
.
Note
The same random-number sequence is generated each
time the program runs. To have the program generate a
different random-number sequence each time it is run, use
the
SRnd
function to initialise the random-number
generator before
Rnd
is called.
See Also
SRnd
Example
The example uses the
Rnd
function to generate 20 random values
in the range from 0 to 10. Each time this program runs, the user
can initialise the random-number generator by using
SRnd
to give
a new seed value.
Содержание tps1100
Страница 1: ...GeoBASIC FOR TPS1100 User Manual Version 2 10 1997 2001 Leica Geosystems AG Heerbrugg Switzerland ...
Страница 150: ...GeoBASIC FOR TPS1100 Reference Manual Version 2 10 1997 2001 Leica Geosystems AG Heerbrugg Switzerland ...
Страница 411: ...GeoBASIC Reference Manual 6 System Functions TPS1100 Version 1 30 6 7 6 5 35 CSV_LibCallAvailable 6 213 ...
Страница 620: ...TPS1100 Version 2 10 6 1 ...
Страница 621: ......
Страница 623: ...TPS1100 Version 2 10 6 1 ...
Страница 624: ......
Страница 1053: ...TPS1100 Version 1 30 E 1 Appendix E GEOFONT ...
Страница 1154: ...GeoBASIC Reference Manual Appendix J List of Predefined Identifiers TPS1100 Version 1 30 J 9 TMC_SetOffsetDist 6 128 ...