Run Code  | API  | Code Wall  | Users  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

fortran-genetic-algo


            
                
            
 run  | edit  | history  | help 0

function rand_range( min, max ) result( x ) real, intent( in ) :: min, max real :: x integer :: sz integer, allocatable :: seed(:)

call random_seed( size = sz )
allocate( seed( sz ) )
call random_seed( get = seed )

x = modulo( rand(), max - min ) + min

end

program hello print *, rand_range( 0.0, 1.0 ) end program hello

  by  Lanitta Johnson, 2 months ago




Please log in to post a comment.
2