I may be doing something daft, I'm trying to generate a 64 bit random number. The following hangs when floor is called.
REAL :: r, z integer(kind=3):: j CALL random_seed() CALL RANDOM_NUMBER(r) print *, \'Random is \', r print *, \'huge is \', Huge(j) z = Huge(j) *r print *, \'z is \', z! Next line hangs. j = floor(Huge(j)*r) print *, 'j is ', j
I can make this work for a 32 bit integer by changing to;
integer(kind=3):: j
What dumbness have I emitted? Also, how should I declare the integer j to avoid the compiler warning if I want a 32 or 64 bit integer?
For example, 32 bit shows;
COMMENT - Specifying the kind of the type INTEGER with a constant is non-portable - 'SELECTED_INT_KIND(9)' would be better
Ryan