summaryrefslogtreecommitdiff
path: root/src/stable/randombase.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2012-11-05 22:41:51 +0000
committerMike Buland <eichlan@xagasoft.com>2012-11-05 22:41:51 +0000
commitec05778d5718a7912e506764d443a78d6a6179e3 (patch)
tree78a9a01532180030c095acefc45763f07c14edb8 /src/stable/randombase.h
parentb20414ac1fe80a71a90601f4cd1767fa7014a9ba (diff)
downloadlibbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.gz
libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.bz2
libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.xz
libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.zip
Converted tabs to spaces with tabconv.
Diffstat (limited to 'src/stable/randombase.h')
-rw-r--r--src/stable/randombase.h36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/stable/randombase.h b/src/stable/randombase.h
index d33bb99..946284f 100644
--- a/src/stable/randombase.h
+++ b/src/stable/randombase.h
@@ -11,25 +11,25 @@
11 11
12namespace Bu 12namespace Bu
13{ 13{
14 class RandomBase 14 class RandomBase
15 { 15 {
16 public: 16 public:
17 RandomBase(); 17 RandomBase();
18 virtual ~RandomBase(); 18 virtual ~RandomBase();
19 19
20 virtual void seed( int32_t iSeed )=0; 20 virtual void seed( int32_t iSeed )=0;
21 virtual int32_t rand()=0; 21 virtual int32_t rand()=0;
22 virtual inline int32_t rand( int32_t iMax ) { 22 virtual inline int32_t rand( int32_t iMax ) {
23 return rand( 0, iMax ); 23 return rand( 0, iMax );
24 } 24 }
25 virtual inline int32_t rand( int32_t iMin, int32_t iMax ) { 25 virtual inline int32_t rand( int32_t iMin, int32_t iMax ) {
26 return iMin+(randNorm()*(iMax-iMin)); 26 return iMin+(randNorm()*(iMax-iMin));
27 } 27 }
28 virtual inline double randNorm() { 28 virtual inline double randNorm() {
29 return (((uint32_t)rand())&0xfffffffeul)*0x1.00000001p-32; 29 return (((uint32_t)rand())&0xfffffffeul)*0x1.00000001p-32;
30// return (((uint32_t)rand())&0xfffffffeul)/(double)(0xfffffffful); 30// return (((uint32_t)rand())&0xfffffffeul)/(double)(0xfffffffful);
31 } 31 }
32 }; 32 };
33}; 33};
34 34
35#endif 35#endif