Files
mir_server/sdk/utils/wrand.h

42 lines
1.0 KiB
C
Raw Normal View History

2025-01-09 17:45:40 +08:00
#ifndef _WELL_RNG_H_
#define _WELL_RNG_H_
/******************************************************************
*
* wyLib库 2008 - 2011
*
* $ WELL算法实现的快速随机函数库 $
*
* - -
*
*
*
*****************************************************************/
/*
* Comments: 使WELL算法产生一个随机数0max以内
* Param unsigned long max:
* @Return unsigned long:
*/
#ifdef __cplusplus
extern "C" {
#endif
//范围一个[0,max)之间的随机数
unsigned long wrand(unsigned long max);
/*
* Comments:
* Param unsigned int seed: 0使time()
* N次随机产生的值都一样
*/
void winitseed(unsigned int seed);
//返回一个随机数
unsigned long wrandvalue();
#ifdef __cplusplus
}
#endif
#endif