www.delorie.com/gnu/docs/gcc/g77_227.html   search  
 
Buy the book!


Using and Porting GNU Fortran

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.152 IRand Intrinsic

 
IRand(Flag)

IRand: INTEGER(KIND=1) function.

Flag: INTEGER; OPTIONAL; scalar; INTENT(IN).

Intrinsic groups: unix.

Description:

Returns a uniform quasi-random number up to a system-dependent limit. If Flag is 0, the next number in sequence is returned; if Flag is 1, the generator is restarted by calling the UNIX function `srand(0)'; if Flag has any other value, it is used as a new seed with srand().

See section 8.11.9.236 SRand Intrinsic.

Note: As typically implemented (by the routine of the same name in the C library), this random number generator is a very poor one, though the BSD and GNU libraries provide a much better implementation than the `traditional' one. On a different system you almost certainly want to use something better.


  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003