views:

542

answers:

7

i want to test some "random" numbers in (0 1). i will test them with the diehard tests battery, but i dont know if it tests numbers in (0 1). so diehard test any kind of numbers, or it just test intergers?

+2  A: 

The Wikipedia entry on the Diehard tests makes no specification that the tests are for integers only, and some of the tests (specifically, the squeeze, runs, and overlapping sums tests) are explicitly done on [0,1). None of the others seem like they would be integer-only from a cursory glance.

Tim
i have seen in the diehard.doc, stored in the diehard.zip this sentence: The tests in DIEHARD require that you provide a large binary file of random integers to be tested. that's why i am confused.
Even if that's the case, can't you just multiply all the floats on [0,1) by some large constant? Statistically, the distribution (standard deviation, etc.) of the numbers would be the same.
Tim
A: 

I am trying to use DIEHARD in order to check a RNG developped in vb.net. I produce a bin file of 32-bit integers, but when i use diehard it doesn't work. I strongly believe that the problem lies on the file that I produce with my random numbers. Does anyone knows how the produced file should look like? I also tried to use ASC2BIN.EXE (I created an ascii file of 32-integers in hex form, 80 characters per line) but unfortunately to no effect. So, if anyone has used diehard to test pre-produced random numbers, and has any good idea, it is very very welcome...

alex
A: 

If anyone is still interested in the answer. Run ASC2BIN.EXE. It describes what you have to do. There also is a .doc-file in the diehard-folder that describes every step you have to make. Its not very intuitive, though.

In principle: Create 3 million 32-bit integers between 0 and INT_MAX. Create an ascii file containing these integers in hex form, that is 8(!) hex digits per number, 80 characters per line. Give it a name with less than 15 characters. Run ASC2BIN.EXE, feed it your file and enjoy ;-).

Oh and if anybody has floats on 0,1 than you need to convert them into the integers that I described above (could multiply by INT_MAX). Yes, diehard uses floats at some places, but it creates these itself from your converted file.

Ben
A: 

Ben wrote: "In principle: Create 3 million 32-bit integers between 0 and INT_MAX. Create an ascii file containing these integers in hex form, that is 8(!) hex digits per number, 80 characters per line. Give it a name with less than 15 characters. Run ASC2BIN.EXE, feed it your file and enjoy ;-)."

I am struggling with this. I have created a .txt file loaded with numbersas described, but to no avail. Is .txt file an acceptable format for ASC2BIN?

Mark
A: 

hello, I am trying to test my output generator but my file is writen in binary (ie 01000101...), i don't understand how i can test it with Diehard. I have always the same error with asc2bin : "run-time error F6501: READ(test128.txt) - end of file encountered" and i don't understand it. I also try to use a file writen in hexadecimal but it doesn't work too. can you help me please, i really want to use this suite ! thank you and sorry for my english, i'm french ;)

vanessa