Search / Sort
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
#ifndef INCLUDED_C_RANDOM_H
|
||||
#define INCLUDED_C_RANDOM_H
|
||||
|
||||
#ifndef INCLUDED_C_TYPES_H
|
||||
#include <c_Types.h>
|
||||
#endif /*INCLUDED_C_TYPES_H*/
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------------------------ */
|
||||
/* */
|
||||
|
||||
/**
|
||||
* @brief 初始化随机数生成引擎(自适应混合熵播种)
|
||||
*
|
||||
* 融合标准时间、高精度纳秒/微秒计时器、当前进程PID
|
||||
* 以及局部变量在栈上的随机内存地址,提供极高的抗种子碰撞能力。
|
||||
*/
|
||||
void c_Random_Init(void);
|
||||
|
||||
/**
|
||||
* @brief 生成指定闭区间 [min, max] 内的高质量均匀分布无符号整数
|
||||
*
|
||||
* @param min 区间下界(包含)
|
||||
* @param max 区间上界(包含)
|
||||
* @return uint64_t 生成的随机数
|
||||
*/
|
||||
uint64_t c_Random_RangeU64(uint64_t min, uint64_t max);
|
||||
|
||||
/**
|
||||
* @brief 生成指定闭区间 [min, max] 内的高质量有符号整数
|
||||
*/
|
||||
int64_t c_Random_RangeI64(int64_t min, int64_t max);
|
||||
|
||||
/**
|
||||
* @brief 生成指定区间 [min, max) 内的双精度浮点数
|
||||
*/
|
||||
double c_Random_RangeDouble(double min, double max);
|
||||
|
||||
#endif /*INCLUDED_C_RANDOM_H*/
|
||||
Reference in New Issue
Block a user