OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [execute/] [random_2.f90] - Blame information for rev 308

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 303 jeremybenn
! Check that the real(4) and real(8) random number generators return the same
2
! sequence of values.
3
program random_4
4
  integer, dimension(:), allocatable :: seed
5
  real(kind=4), dimension(10) :: r4
6
  real(kind=8), dimension(10) :: r8
7
  real, parameter :: delta = 0.0001
8
  integer n
9
 
10
  call random_seed (size=n)
11
  allocate (seed(n))
12
  call random_seed (get=seed)
13
  ! Test both array valued and scalar routines.
14
  call random_number(r4)
15
  call random_number (r4(10))
16
 
17
  ! Reset the seed and get the real(8) values.
18
  call random_seed (put=seed)
19
  call random_number(r8)
20
  call random_number (r8(10))
21
 
22
  if (any ((r4 - r8) .gt. delta)) call abort
23
end program
24
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.