aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Utilities/Util.h
diff options
context:
space:
mode:
authorVincent-Michael <Vincent_Michael@gmx.de>2014-07-25 19:35:11 +0200
committerVincent-Michael <Vincent_Michael@gmx.de>2014-07-25 19:35:11 +0200
commit5a8e79528f06d8dabe1d038d8e079be29adf7e1e (patch)
tree42f171161adb381638f7ab1c6261f9501f1f3512 /src/server/shared/Utilities/Util.h
parent339574e2fdcd654280cd06a38466cab44eab5133 (diff)
parentc60bdec16046c0bb908e84039f8b1c22368363bd (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Diffstat (limited to 'src/server/shared/Utilities/Util.h')
-rw-r--r--src/server/shared/Utilities/Util.h25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/server/shared/Utilities/Util.h b/src/server/shared/Utilities/Util.h
index 2a776715521..c8883773eed 100644
--- a/src/server/shared/Utilities/Util.h
+++ b/src/server/shared/Utilities/Util.h
@@ -76,30 +76,23 @@ std::string secsToTimeString(uint64 timeInSecs, bool shortText = false, bool hou
uint32 TimeStringToSecs(const std::string& timestring);
std::string TimeToTimestampStr(time_t t);
-/* Return a random number in the range min..max; (max-min) must be smaller than 32768. */
+/* Return a random number in the range min..max. */
int32 irand(int32 min, int32 max);
-/* Return a random number in the range min..max (inclusive). For reliable results, the difference
-* between max and min should be less than RAND32_MAX. */
+/* Return a random number in the range min..max (inclusive). */
uint32 urand(uint32 min, uint32 max);
-/* Return a random number in the range 0 .. RAND32_MAX. */
-int32 rand32();
+/* Return a random number in the range 0 .. UINT32_MAX. */
+uint32 rand32();
/* Return a random number in the range min..max */
float frand(float min, float max);
-/* Return a random double from 0.0 to 1.0 (exclusive). Floats support only 7 valid decimal digits.
- * A double supports up to 15 valid decimal digits and is used internally (RAND32_MAX has 10 digits).
- * With an FPU, there is usually no difference in performance between float and double.
-*/
-double rand_norm(void);
-
-/* Return a random double from 0.0 to 99.9999999999999. Floats support only 7 valid decimal digits.
- * A double supports up to 15 valid decimal digits and is used internally (RAND32_MAX has 10 digits).
- * With an FPU, there is usually no difference in performance between float and double.
-*/
-double rand_chance(void);
+/* Return a random double from 0.0 to 1.0 (exclusive). */
+double rand_norm();
+
+/* Return a random double from 0.0 to 100.0 (exclusive). */
+double rand_chance();
/* Return true if a random roll fits in the specified chance (range 0-100). */
inline bool roll_chance_f(float chance)