Click here to Skip to main content
15,922,419 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to modify these matrix? [modified] Pin
CPallini3-Jan-08 0:57
mveCPallini3-Jan-08 0:57 
QuestionRe: how to modify these matrix? Pin
David Crow3-Jan-08 2:58
David Crow3-Jan-08 2:58 
GeneralRe: how to modify these matrix? Pin
CPallini3-Jan-08 3:18
mveCPallini3-Jan-08 3:18 
GeneralRe: how to modify these matrix?[modifed 4/01/08] Pin
gentleguy3-Jan-08 14:43
gentleguy3-Jan-08 14:43 
GeneralRe: how to modify these matrix?[modifed 4/01/08] Pin
David Crow3-Jan-08 15:50
David Crow3-Jan-08 15:50 
GeneralRe: how to modify these matrix?[modifed 4/01/08] Pin
CPallini3-Jan-08 20:59
mveCPallini3-Jan-08 20:59 
AnswerRe: how to modify these matrix? Pin
David Crow3-Jan-08 2:47
David Crow3-Jan-08 2:47 
AnswerRe: how to modify these matrix? Pin
Randor 3-Jan-08 6:51
professional Randor 3-Jan-08 6:51 
You should seed the random number generator before each retrieval of a random number.

I suggest to create a function which returns a random integer.

Note:
Functions such as time(NULL) or clock() have a high probability of seeding the generator with the same seed since your code will execute faster than the time quantum available to such functions.

Try something like the following:

double DblRand()
{
	unsigned __int64 ui64Seed;
	__asm
	{
		rdtsc;
		mov dword ptr ui64Seed, eax;
		mov dword ptr ui64Seed + 4, edx;
	}
	srand((unsigned int)ui64Seed + clock());
	return (double)rand() / 32767;
}


Best Wishes,
-David Delaune
GeneralRe: how to modify these matrix? Pin
CPallini3-Jan-08 7:23
mveCPallini3-Jan-08 7:23 
GeneralRe: how to modify these matrix? Pin
Randor 3-Jan-08 7:33
professional Randor 3-Jan-08 7:33 
GeneralRe: how to modify these matrix? Pin
CPallini3-Jan-08 7:52
mveCPallini3-Jan-08 7:52 
GeneralRe: how to modify these matrix? Pin
gentleguy3-Jan-08 14:36
gentleguy3-Jan-08 14:36 
GeneralA project made from XPCOM components and VC++ - I posted this messaje before several hours ago Pin
cuesdean florin3-Jan-08 0:38
cuesdean florin3-Jan-08 0:38 
QuestionRe: A project made from XPCOM components and VC++ - I posted this messaje before several hours ago Pin
Matthew Faithfull3-Jan-08 1:02
Matthew Faithfull3-Jan-08 1:02 
GeneralRe: A project made from XPCOM components and VC++ - I posted this messaje before several hours ago Pin
cuesdean florin3-Jan-08 1:34
cuesdean florin3-Jan-08 1:34 
GeneralRe: A project made from XPCOM components and VC++ - I posted this messaje before several hours ago Pin
Matthew Faithfull3-Jan-08 1:56
Matthew Faithfull3-Jan-08 1:56 
GeneralRe: A project made from XPCOM components and VC++ - I posted this messaje before several hours ago Pin
cuesdean florin3-Jan-08 4:10
cuesdean florin3-Jan-08 4:10 
GeneralRe: A project made from XPCOM components and VC++ - I posted this messaje before several hours ago Pin
Matthew Faithfull3-Jan-08 4:19
Matthew Faithfull3-Jan-08 4:19 
GeneralRe: A project made from XPCOM components and VC++ - I posted this messaje before several hours ago Pin
Jeremy Falcon3-Jan-08 6:17
professionalJeremy Falcon3-Jan-08 6:17 
GeneralRe: A project made from XPCOM components and VC++ - I posted this messaje before several hours ago Pin
Maxwell Chen3-Jan-08 16:15
Maxwell Chen3-Jan-08 16:15 
Generalchar* and unsigned int Pin
CodingLover3-Jan-08 0:26
CodingLover3-Jan-08 0:26 
QuestionRe: char* and unsigned int Pin
CPallini3-Jan-08 0:35
mveCPallini3-Jan-08 0:35 
GeneralRe: char* and unsigned int Pin
CodingLover3-Jan-08 0:39
CodingLover3-Jan-08 0:39 
GeneralRe: char* and unsigned int Pin
CPallini3-Jan-08 0:49
mveCPallini3-Jan-08 0:49 
QuestionRe: char* and unsigned int Pin
fantasy12153-Jan-08 16:39
fantasy12153-Jan-08 16:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.