Changeset 44 for trunk/src/shared/Util.h
- Timestamp:
- 11/19/08 13:27:40 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/shared/Util.h
r2 r44 1 1 /* 2 * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/> 2 * Copyright (C) 2008 Trinity <http://www.trinitycore.org/> 3 * 4 * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/> 3 5 * 4 6 * This program is free software; you can redistribute it and/or modify … … 9 11 * This program is distributed in the hope that it will be useful, 10 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 14 * GNU General Public License for more details. 13 15 * 14 16 * You should have received a copy of the GNU General Public License 15 17 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307USA18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 19 */ 18 20 … … 42 44 43 45 /* Return a random number in the range min..max; (max-min) must be smaller than 32768. */ 44 MANGOS_DLL_SPEC int32 irand(int32 min, int32 max);46 TRINITY_DLL_SPEC int32 irand(int32 min, int32 max); 45 47 46 48 /* Return a random number in the range min..max (inclusive). For reliable results, the difference 47 49 * between max and min should be less than RAND32_MAX. */ 48 MANGOS_DLL_SPEC uint32 urand(uint32 min, uint32 max);50 TRINITY_DLL_SPEC uint32 urand(uint32 min, uint32 max); 49 51 50 52 /* Return a random number in the range 0 .. RAND32_MAX. */ 51 MANGOS_DLL_SPEC int32 rand32();53 TRINITY_DLL_SPEC int32 rand32(); 52 54 53 55 /* Return a random double from 0.0 to 1.0 (exclusive). Floats support only 7 valid decimal digits. 54 56 * A double supports up to 15 valid decimal digits and is used internally (RAND32_MAX has 10 digits). 55 57 * With an FPU, there is usually no difference in performance between float and double. */ 56 MANGOS_DLL_SPEC double rand_norm(void);58 TRINITY_DLL_SPEC double rand_norm(void); 57 59 58 60 /* Return a random double from 0.0 to 99.9999999999999. Floats support only 7 valid decimal digits. 59 61 * A double supports up to 15 valid decimal digits and is used internaly (RAND32_MAX has 10 digits). 60 62 * With an FPU, there is usually no difference in performance between float and double. */ 61 MANGOS_DLL_SPEC double rand_chance(void);63 TRINITY_DLL_SPEC double rand_chance(void); 62 64 63 65 /* Return true if a random roll fits in the specified chance (range 0-100). */