File: floor_03.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 (17 lines) | stat: -rw-r--r-- 420 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
program floor_03
  implicit none
  real :: x1, x2, x3
  real :: y1, y2, y3
  x1 = 3.3 ! 3
  x2 = 3.5 ! 3
  x3 = 3.7 ! 3
  y1 = -3.3 ! -4
  y2 = -3.5 ! -4
  y3 = -3.7 ! -4
    
  if(floor(x1) /= 3 .or. floor(x2) /= 3 .or. floor(x3) /= 3) error stop
  if(floor(y1) /= -4 .or. floor(y2) /= -4 .or. floor(y3) /= -4) error stop

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