Changeset 1823
- Timestamp:
- Sep 22, 2008, 6:42:39 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/util/Math.h
r1791 r1823 216 216 217 217 /** 218 @brief Returns a random number between 0 and 1.218 @brief Returns a random number between 0 and almost 1: 0 <= rnd < 1. 219 219 */ 220 220 inline _UtilExport float rnd() 221 221 { 222 return ((float)rand() / RAND_MAX);223 } 224 225 /** 226 @brief Returns a random number between 0 and max.222 return ((float)rand() / (RAND_MAX + 1)); 223 } 224 225 /** 226 @brief Returns a random number between 0 and almost max: 0 <= rnd < max. 227 227 @param max The maximum 228 228 */ … … 233 233 234 234 /** 235 @brief Returns a random number between min and max.235 @brief Returns a random number between min and almost max: min <= rnd < max. 236 236 @param min The minimum 237 237 @param max The maximum
Note: See TracChangeset
for help on using the changeset viewer.