Navigation:  ThinBASIC Modules > Math > Random Numbers >

RND2

Previous pageReturn to chapter overviewNext page

 

Description

 

Returns a uniform random deviate between 0.0 and 1.0.

0 < RND2 < 1

 

Syntax

 

n = RND2(idum)

 

Returns

 

Number. Result in radians

 

Parameters

 

Name

Type

Optional

Meaning

idum

Number

No

Any numerical expression

 

Remarks

 

Set idum negative to seed function.

Then, do not alter its value between function calls.

 

Function thanks to Dan Baron.

Function source from "Numerical Recipes in C", 2nd edition, p.282.

 

Restrictions

 

See also

 

Examples

 

http://community.thinbasic.com/index.php?topic=3267.msg24542#msg24542