home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / adaptor.zip / adapt.zip / adaptor / examples / dalib / reduct / bool.f next >
Text File  |  1993-03-23  |  751b  |  41 lines

  1.       program test
  2.  
  3.       integer k
  4.       parameter (k = 3)
  5.  
  6.       logical a(k)
  7.  
  8.       a(1) = .true.
  9.       a(2) = .false.
  10.       a(3) = .true.
  11.  
  12.       call alltest (a, k, .false.)
  13.       call anytest (a, k, .true.)
  14.       call paritytest (a, k, .false.)
  15.  
  16.       end
  17.  
  18.       subroutine alltest (a, N, result)
  19.       logical a(n), s, result
  20.  
  21.       s = all (a)
  22.       print *, 'ALL: Result is ', s, ' should be ', result
  23.  
  24.       end
  25.  
  26.       subroutine anytest (a, N, result)
  27.       logical a(n), s, result
  28.  
  29.       s = any (a)
  30.       print *, 'ANY: Result is ', s, ' should be ', result
  31.  
  32.       end
  33.  
  34.       subroutine paritytest (a, N, result)
  35.       logical a(n), s, result
  36.  
  37.       s = parity (a)
  38.       print *, 'PARITY: Result is ', s, ' should be ', result
  39.  
  40.       end
  41.