Personal tools
You are here: Home Projects C++ Cfront releases Release 3.0.3 source lib task_SPARC TESTS rand.C
Document Actions

rand.C

by Michael L Powell last modified 2007-01-26 03:22

Click here to get the file

Size 1 kB - File type text/plain

File contents

#include <task.h>

/*  Test of random number generating classes in libtask
 */

const int MAXI = 10000;

main()
{
	int r;
	urand ur(5,7);
	histogram H(3,5,7);
	for (int i = 1; i <= MAXI; i++) {
		r = ur.draw();
		H.add(r);
		//if (i % 10)	printf("r = %d\t", r);
		//else		printf("r = %d\n", r);
	}
	printf("Histogram H:\n");
	H.print();
	thistask->resultis(0);
}
« March 2024 »
Su Mo Tu We Th Fr Sa
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: