Generation of uniformly distributed random numbers (0,1) - page 16

 

S, come on, I'm talking about the ACF, for example.

 
Mathemat >>:

S, ну ты чо? Я говорю об АКФ, например.

Yeah, I see.

 

There you go, straight into the bushes. Is that all you had to say?

 
Mathemat >>:

Ну вот, сразу в кусты. Это все, что ты хотел сказать?

Was it something I wanted to say? :) I didn't understand you, I clarified - you clarified. But :) . Yeah, I even sort of answered your question. :)

By the way - you make your thoughts easier and clearer to everyone. :) Sometimes I'm not understandin' what you're tryin' to say.

 

I don't always know what I want to say myself :)

I think I'm beginning to guess why my posts make you want to swear.

 
gumgum >>:


10000000 ranD(1,40) speed = 37.95500000 div=1/div

10000000 ranD(1,40) speed = 26.34800000 div=div*0.5

:)

Perhaps we should clarify that the numbers here are not speed, but time. That is, div*0.5 is about one and a half times faster.

 

This is what the mql's GSC draws :


:о)

 
gumgum >>:
Может кто нибудь сделает dll например из Генерация случайных чисел? Спасибо.

Relevant?

I get it from my sound card

 
MaStak >>:

Актуально ?

У меня со звуковой карты берёт


Of course! It will be very good!
 

AuxDll.dll function description:

OpenAux - Opens audio device for reading, called 1 time. Returns 0 if successful, failure (-1).

RealRandom - reads an audio buffer and copies it to an internal array of 256 bytes. Channels in this buffer are alternated ( Buffer[L, R, L, R, L, etc.] ). I.e. the current voltage in the channel e.g. L = Buffer[0]*256 + Buffer[2]. This is the value this function returns, thus we have the range of return values [0 ... 65535]. This function can not be called if the device is not open.

GetByte - Debug function. It returns the value of any byte from the array I mentioned above. Theoretically, the array index passed into the function can be >255. C++ is loyal in this sense. But how will it end? At best, it will return a memory byte having nothing to do with the sound.)

CloseAux - Closes the sound device. Don't forget to call it when finished. Otherwise, an unclosed device will continue to record to memory.


Prototypes:

int OpenAux();
int RealRandom();
void CloseAux();
BYTE GetByte(int _i);


MQL example

// *** Импорт ***
#import "AuxDll.dll"
int OpenAux();
int RealRandom();
void CloseAux();
int GetByte(int _i);
#import
bool StateAux=false;


int init(){
//----
OpenAux();
//----


return(0);}

int start(){

int Rnd=RealRandom();


return(0);}


int deinit(){
//----
CloseAux();

//---

return(0);}

I even soldered a headset for it . But later it was discovered that it picks up any sound on the computer.


Now AUXmeter.exe

Just a test prog, the library must lie next to it. The lines indicate the dropped out numbers, the more often the same number dropped out, the longer its line (don't forget about scrollbar to look through the whole range). The chart is automatically scaled.

Buttons

START - To start the test. Internal functions are used to open and use the sound device, the library is not needed.

STOP - Stops the test.

Open - OpenAux() function test. Library is required. The value returned by the function is shown on the button.

Sampling - Test the RealRandom() function. The library is required. The value returned by this function will be displayed on the button.

Close - Test of the CloseAux() function. Library is needed.

Between the buttons is a sample counter for the test.

That seems to be all.

Files:
auxdll.rar  8 kb