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

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [execute/] [intrinsic_integer.f90] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
! Program to test the real->integer conversion routines.
2
program intrinsic_integer
3
  implicit none
4
 
5
  call test (0.0, (/0, 0, 0, 0/))
6
  call test (0.3, (/0, 1, 0, 0/))
7
  call test (0.7, (/0, 1, 0, 1/))
8
  call test (-0.3, (/-1, 0, 0, 0/))
9
  call test (-0.7, (/-1, 0, 0, -1/))
10
contains
11
subroutine test(val, res)
12
  real :: val
13
  integer, dimension(4) :: res
14
 
15
  if ((floor(val) .ne. res(1)) .or. (ceiling(val) .ne. res(2)) &
16
      .or. (int(val) .ne. res(3)) .or. (nint(val) .ne. res(4))) call abort
17
end subroutine
18
end program

powered by: WebSVN 2.1.0

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