mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: Random: missing scalar division
This commit is contained in:
@ -59,6 +59,10 @@ Description
|
|||||||
|
|
||||||
#ifdef USE_RANDOM
|
#ifdef USE_RANDOM
|
||||||
# include <climits>
|
# include <climits>
|
||||||
|
# if INT_MAX != 2147483647
|
||||||
|
# error "INT_MAX != 2147483647"
|
||||||
|
# error "The random number generator may not work!"
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -1250,7 +1254,7 @@ Foam::label Foam::osRandomInteger()
|
|||||||
Foam::scalar Foam::osRandomDouble()
|
Foam::scalar Foam::osRandomDouble()
|
||||||
{
|
{
|
||||||
#ifdef USE_RANDOM
|
#ifdef USE_RANDOM
|
||||||
return (scalar)random();
|
return (scalar)random()/INT_MAX;
|
||||||
#else
|
#else
|
||||||
return drand48();
|
return drand48();
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user