?
=?ISO-8859-1?Q?Martin_J=F8rgensen?=
Hi,
Short question:
Any particular reason for why I'm getting a warning here:
(cast from function call of type int to non-matching type double)
xdouble = (double)rand()/(double)RAND_MAX;
xdouble is ofcourse of type double. So everything should be casted to
type double. Then I don't see why the compiler (gcc) complains. The line
should create a (type double) random number between 0 and 1 and it would
be nice to have this warning go away...
Best regards
Martin Jørgensen
Short question:
Any particular reason for why I'm getting a warning here:
(cast from function call of type int to non-matching type double)
xdouble = (double)rand()/(double)RAND_MAX;
xdouble is ofcourse of type double. So everything should be casted to
type double. Then I don't see why the compiler (gcc) complains. The line
should create a (type double) random number between 0 and 1 and it would
be nice to have this warning go away...
Best regards
Martin Jørgensen