【お知らせ】この部分は英語原文のみでの提供となります。何卒ご了承ください。
2.1.24.8.20 unidrnd
Contents
Description
Generates an array of random integers from a uniform distribution, seeds and generator number passed explicitly
Syntax
int unidrnd( long * v, uint n, int a, int b )
Parameters
- v
- [output] Pointer to a double array, which contain the results
- n
- [input] The number of pseudo-random numbers to be generated. n>=1
- a
- [input] The end-point a of the uniform distribution
- b
- [input] The end-point b of the uniform distribution
Return
Return NE_NOERROR(0) on success, otherwise error
Examples
EX1
//This example is to generate pseudo-random numbers from a uniform distribution int unidrnd_ex1() { int n = 10; long v[10]; int a = -5, b = 5; int nRet = unidrnd( v, n, a, b); if(0 != nRet) return 0; for(int i=0;i<n;i++) printf("v[%d]: %d\n",i, v[i]); return 1; }
Remark
See Also
Header to Include
origin.h