File: floor_01.f90

package info (click to toggle)
lfortran 0.60.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 58,416 kB
  • sloc: cpp: 173,406; f90: 80,491; python: 17,586; ansic: 9,610; yacc: 2,356; sh: 1,401; fortran: 895; makefile: 38; javascript: 15
file content (15 lines) | stat: -rw-r--r-- 514 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
program floor_01
  implicit none
  real, parameter :: x1 = 3.3 ! 3
  real, parameter :: x2 = 3.5 ! 3
  real, parameter :: x3 = 3.7 ! 3
  real, parameter :: y1 = -3.3 ! -4
  real, parameter :: y2 = -3.5 ! -4
  real, parameter :: y3 = -3.7 ! -4

  if(floor(x1, kind=8) /= 3_8 .or. floor(x2) /= 3 .or. floor(x3) /= 3) error stop
  if(floor(y1, kind=4) /= -4 .or. floor(y2) /= -4 .or. floor(y3, kind=8) /= -4) error stop

  print*, floor(x1), floor(x2), floor(x3)
  print*, floor(y1), floor(y2), floor(y3)
end program