beautypg.com

Rpbasic-52 programming guide – Remote Processing BASIC 52 User Manual

Page 116

background image

RPBASIC-52 PROGRAMMING GUIDE

2-97

RND

Syntax:

R N D

Function:

Returns a pseudo-random fractional number between zero and one inclusive.

Mode:

Comm and, run

Use:

A = R N D

Cards:

All

D E S C R IP T I ON

The RND operator uses a 16-bit binary seed and repeats after 65535 pseudo-random numbers. The initial
s e e d i s th e v al u e o f M T O P . T h e se e d ca n b e c h a ng e d by w r it i ng t o a d d re s s 1 0 C H a nd 1 0 D H us i ng t he X B Y
command.

EXAMPLE

100 A=RND
110 PRINT A