-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrnddet.h
46 lines (36 loc) · 1.33 KB
/
rnddet.h
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
#ifndef _RNDDET_INCL
#define _RNDDET_INCL
#include "rnd.h"
using namespace std;
class RNDDET: public RND // just because of compatibility
{
// Members: ********************************************
private:
double Value; // fixed value
long LValue;
// Methods: ********************************************
public:
// Constructor *****************************************
RNDDET(double val) // for doubles
{
Value = val; // double:
LValue = (long)(val + 1e-11); // rounds off!!!
}
RNDDET(int lval) // for longs
{
// Value = (double)lval;
Value = lval; // integer
LValue = lval; // less critical
}
// margins *********************************************
double GetMinRndValue()
{ return Value; }
double GetMaxRndValue()
{ return Value; }
// public generators **********************************
virtual inline double Rnd() { return Value; }
virtual inline long RndL() { return LValue; }
// friend: output operator *****************************
friend ostream& operator<<(ostream& outp, RNDDET& gen);
};
#endif