1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//
// GENERATED FILE
//
use super::*;
use f2rust_std::*;
//$Procedure T_RANDD ( Random double precision number )
pub fn T_RANDD(
LOWER: f64,
UPPER: f64,
SEED: &mut i32,
ctx: &mut Context,
) -> f2rust_std::Result<f64> {
let mut T_RANDD: f64 = 0.0;
//
// SPICELIB functions
//
//
// Other functions
//
//
// Give the function an initial value.
//
T_RANDD = LOWER;
//
// Standard SPICE error handling.
//
if spicelib::RETURN(ctx) {
return Ok(T_RANDD);
} else {
spicelib::CHKIN(b"T_RANDD", ctx)?;
}
//
// Check bounds.
//
if (LOWER > UPPER) {
spicelib::SETMSG(b"Lower, upper bounds are: # #. ", ctx);
spicelib::ERRDP(b"#", LOWER, ctx);
spicelib::ERRDP(b"#", UPPER, ctx);
spicelib::SIGERR(b"SPICE(INVALIDBOUNDS)", ctx)?;
spicelib::CHKOUT(b"T_RANDD", ctx)?;
return Ok(T_RANDD);
}
//
// Get a random number in the range [LOWER, UPPER]. The
// T_URAND function returns numbers in the range [0, 1].
//
T_RANDD = (LOWER + ((UPPER - LOWER) * T_URAND(SEED, ctx)));
spicelib::CHKOUT(b"T_RANDD", ctx)?;
Ok(T_RANDD)
}