「Random(API)」の版間の差分
提供: Eospedia
(ページの作成:「General/'''Random'''は乱数を取り扱うのためのAPI です。 == 定数 == == 構造体 == typedef double randomParaTypeReal; == API == ===乱数生成=== 範...」) |
|||
行1: | 行1: | ||
− | General/'''Random''' | + | General/'''Random'''は乱数を取り扱うのための[[API]]です。 |
== 定数 == | == 定数 == |
2014年10月2日 (木) 07:47時点における最新版
General/Randomは乱数を取り扱うのためのAPIです。
定数
構造体
typedef double randomParaTypeReal;
API
乱数生成
範囲: (0 < x <= 1)で乱数を生成します。
#define random() ((1.0/(RAND_MAX + 1.0))*rand())
一様乱数を生成します。
extern randomParaTypeReal randomUniformGet(randomParaTypeReal min, randomParaTypeReal max, long mode);
正規乱数を生成します。
extern randomParaTypeReal randomNormalGet(long mode);
時間による擬似乱数の種を設定します。
extern void srandomByTime();