GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
genunf.f
Go to the documentation of this file.
1 REAL function genunf(low,high)
2C**********************************************************************
3C
4C REAL FUNCTION GENUNF( LOW, HIGH )
5C
6C GeNerate Uniform Real between LOW and HIGH
7C
8C
9C Function
10C
11C
12C Generates a real uniformly distributed between LOW and HIGH.
13C
14C
15C Arguments
16C
17C
18C LOW --> Low bound (exclusive) on real value to be generated
19C REAL LOW
20C
21C HIGH --> High bound (exclusive) on real value to be generated
22C REAL HIGH
23C
24C**********************************************************************
25C .. Scalar Arguments ..
26 REAL high,low
27C ..
28C .. External Functions ..
29 REAL ranf
30 EXTERNAL ranf
31C ..
32C .. Executable Statements ..
33 IF (.NOT. (low.GT.high)) GO TO 10
34 WRITE (*,*) 'LOW > HIGH in GENUNF: LOW ',low,' HIGH: ',high
35 WRITE (*,*) 'Abort'
36 CALL xstopx ('LOW > High in GENUNF - Abort')
37
38 10 genunf = low + (high-low)*ranf()
39
40 RETURN
41
42 END
real function genunf(low, high)
Definition genunf.f:2
real function ranf()
Definition ranf.f:2