diff options
author | flaviojs <flaviojs@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-06-25 22:09:35 +0000 |
---|---|---|
committer | flaviojs <flaviojs@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-06-25 22:09:35 +0000 |
commit | 04452763110f0245617c876ecbb271dffb01d05d (patch) | |
tree | 0a4f62380247564924b857b9bc30136075655ae4 /src/common/random.h | |
parent | 61eba2c6dca99935b2d0702188f1a2dde1f242db (diff) | |
download | hercules-04452763110f0245617c876ecbb271dffb01d05d.tar.gz hercules-04452763110f0245617c876ecbb271dffb01d05d.tar.bz2 hercules-04452763110f0245617c876ecbb271dffb01d05d.tar.xz hercules-04452763110f0245617c876ecbb271dffb01d05d.zip |
* Added Mersenne Twister MT19937 as a random number generator.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14865 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/random.h')
-rw-r--r-- | src/common/random.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/common/random.h b/src/common/random.h new file mode 100644 index 000000000..1bb8ecfb5 --- /dev/null +++ b/src/common/random.h @@ -0,0 +1,20 @@ +// Copyright (c) Athena Dev Teams - Licensed under GNU GPL +// For more information, see LICENCE in the main folder + +#ifndef _RANDOM_H_ +#define _RANDOM_H_ + +#ifndef _CBASETYPES_H_ +#include "../common/cbasetypes.h" +#endif + +void rnd_init(void); +void rnd_seed(uint32); + +uint32 rnd(void);// [0, UINT32_MAX] +uint32 rnd_roll(uint32 dice_faces);// [0, dice_faces) +int32 rnd_value(int32 min, int32 max);// [min, max] +double rnd_uniform(void);// [0.0, 1.0) +double rnd_uniform53(void);// [0.0, 1.0) + +#endif /* _RANDOM_H_ */ |