| 1 | program p
|
|---|
| 2 | implicit none
|
|---|
| 3 | integer a,b,res
|
|---|
| 4 | real ar,br,resr
|
|---|
| 5 | double precision ad,bd,resd
|
|---|
| 6 | character c1*3,c2*3,c3*6
|
|---|
| 7 | logical t,f
|
|---|
| 8 |
|
|---|
| 9 | f = 2 .ge. 3
|
|---|
| 10 | c$ civl assert(.not. f)
|
|---|
| 11 | t = 2 .ge. 2
|
|---|
| 12 | c$ civl assert(t)
|
|---|
| 13 | f = 2 .gt. 2
|
|---|
| 14 | c$ civl assert(.not. f)
|
|---|
| 15 | t = 2 .gt. 1
|
|---|
| 16 | c$ civl assert(t)
|
|---|
| 17 | f = 3 .le. 2
|
|---|
| 18 | c$ civl assert(.not. f)
|
|---|
| 19 | t = 2 .le. 2
|
|---|
| 20 | c$ civl assert(t)
|
|---|
| 21 | f = 2 .lt. 2
|
|---|
| 22 | c$ civl assert(.not. f)
|
|---|
| 23 | t = 1 .lt. 2
|
|---|
| 24 | c$ civl assert(t)
|
|---|
| 25 | t = 1 .eq. 1
|
|---|
| 26 | c$ civl assert(t)
|
|---|
| 27 | f = 1 .eq. 2
|
|---|
| 28 | c$ civl assert(.not. f)
|
|---|
| 29 | t = 1 .ne. 2
|
|---|
| 30 | c$ civl assert(t)
|
|---|
| 31 | f = 1 .ne. 1
|
|---|
| 32 | c$ civl assert(.not. f)
|
|---|
| 33 |
|
|---|
| 34 | t = .true. .eqv. .true.
|
|---|
| 35 | c$ civl assert(t)
|
|---|
| 36 | t = .false. .eqv. .false.
|
|---|
| 37 | c$ civl assert(t)
|
|---|
| 38 | f = .false. .eqv. .true.
|
|---|
| 39 | c$ civl assert(.not. f)
|
|---|
| 40 | t = .true. .neqv. .false.
|
|---|
| 41 | c$ civl assert(t)
|
|---|
| 42 | f = .false. .neqv. .false.
|
|---|
| 43 | c$ civl assert(.not. f)
|
|---|
| 44 | f = .true. .neqv. .true.
|
|---|
| 45 | c$ civl assert(.not. f)
|
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 | c1 = "a"
|
|---|
| 49 | c2 = "def"
|
|---|
| 50 | c3 = c1//c2
|
|---|
| 51 | c$ civl assert(c3 .eq. "a def")
|
|---|
| 52 | c character strings are truncated if assigned to shorter target
|
|---|
| 53 | c2 = c3
|
|---|
| 54 | c$ civl assert(c2 .eq. "abc")
|
|---|
| 55 | c character strings are padded if assigned to longer target
|
|---|
| 56 | c3 = c2
|
|---|
| 57 | c$ civl assert(c3 .eq. "abc")
|
|---|
| 58 | c comparison evaluates to .true. regardless of trailing blanks
|
|---|
| 59 | c$ civl assert(c3 .eq. "abc ")
|
|---|
| 60 | c blanks at the start matter though
|
|---|
| 61 | c$ civl assert(.not. c3 .eq. " abc")
|
|---|
| 62 |
|
|---|
| 63 | a = 2
|
|---|
| 64 | b = 3
|
|---|
| 65 |
|
|---|
| 66 | res = a+b
|
|---|
| 67 | c$ civl assert(res .eq. 5)
|
|---|
| 68 | res = a*b
|
|---|
| 69 | c$ civl assert(res .eq. 6)
|
|---|
| 70 | res = b/a
|
|---|
| 71 | c$ civl assert(res .eq. 1)
|
|---|
| 72 | res = a-b
|
|---|
| 73 | c$ civl assert(res .eq. -1)
|
|---|
| 74 | res = a**b
|
|---|
| 75 | c$ civl assert(res .eq. 8)
|
|---|
| 76 | res = +a
|
|---|
| 77 | c$ civl assert(res .eq. 2)
|
|---|
| 78 | res = -a
|
|---|
| 79 | c$ civl assert(res .eq. -2)
|
|---|
| 80 |
|
|---|
| 81 | ar = a
|
|---|
| 82 | br = b
|
|---|
| 83 | resr = ar+br
|
|---|
| 84 | c$ civl assert(resr .eq. 5)
|
|---|
| 85 | resr = ar*br
|
|---|
| 86 | c$ civl assert(resr .eq. 6)
|
|---|
| 87 | resr = br/ar
|
|---|
| 88 | c$ civl assert(resr .eq. 1.5)
|
|---|
| 89 | resr = ar-br
|
|---|
| 90 | c$ civl assert(resr .eq. -1)
|
|---|
| 91 | resr = ar**br
|
|---|
| 92 | c$ civl assert(resr .eq. 8)
|
|---|
| 93 | resr = +ar
|
|---|
| 94 | c$ civl assert(resr .eq. 2)
|
|---|
| 95 | resr = -ar
|
|---|
| 96 | c$ civl assert(resr .eq. -2)
|
|---|
| 97 |
|
|---|
| 98 | ad = a
|
|---|
| 99 | bd = b
|
|---|
| 100 | resd = ad+bd
|
|---|
| 101 | c$ civl assert(resd .eq. 5)
|
|---|
| 102 | resd = ad*bd
|
|---|
| 103 | c$ civl assert(resd .eq. 6)
|
|---|
| 104 | resd = bd/ad
|
|---|
| 105 | c$ civl assert(resd .eq. 1.5)
|
|---|
| 106 | resd = ad-bd
|
|---|
| 107 | c$ civl assert(resd .eq. -1)
|
|---|
| 108 | resd = ad**bd
|
|---|
| 109 | c$ civl assert(resd .eq. 8)
|
|---|
| 110 | resd = +ad
|
|---|
| 111 | c$ civl assert(resd .eq. 2)
|
|---|
| 112 | resd = -ad
|
|---|
| 113 | c$ civl assert(resd .eq. -2)
|
|---|
| 114 | end program
|
|---|