home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / sigm / vols000 / vol078 / benchmk.for < prev    next >
Text File  |  1984-04-29  |  4KB  |  157 lines

  1. FORTRAN BENCHMARK LISTINGS BM1 to 9 
  2.  
  3. LISTINGS OF BM1 to BM8 FROM COMPUTING EUROPE JULY 27 1978
  4.  
  5.       PROGRAM BM1          
  6.       WRITE(3,1)           
  7.     1 FORMAT(9H Start BM1)       
  8.       DO 2 K=1,1000        
  9.     2 CONTINUE             
  10.       WRITE(3,3)           
  11.     3 FORMAT(2H E)         
  12.       STOP                 
  13.       END                  
  14.                            
  15.                            
  16. ----------------------  
  17.  
  18.       PROGRAM BM2           
  19.       WRITE(3,1)            
  20.     1 FORMAT(9H Start BM2)        
  21.       K=0                   
  22.     2 K=K+1                 
  23.       IF(K.LT.1000)GOTO 2   
  24.       WRITE(3,3)            
  25.     3 FORMAT(2H E)          
  26.       STOP                  
  27.       END                   
  28.                             
  29. ----------------------  
  30.  
  31.       PROGRAM BM3        
  32.       WRITE(3,1)         
  33.     1 FORMAT(9H Start BM3)
  34.       K=0                
  35.     2 K=K+1              
  36.       A=K/K*K+K-K        
  37.       IF(K.LT.1000)GOTO 2
  38.       WRITE(3,3)         
  39.     3 FORMAT(2H E)       
  40.       STOP               
  41.       END                
  42.  
  43.       SUBROUTINE GOSUB        
  44.       RETURN              
  45.       END                 
  46.  
  47. ----------------------  
  48.  
  49.       PROGRAM BM4          
  50.       WRITE(3,1)           
  51.     1 FORMAT(9H Start BM4)       
  52.       K=0                  
  53.     2 K=K+1                
  54.       A=K/2*3+4-5          
  55.       IF(K.LT.1000) GO TO 2
  56.       WRITE(3,3)           
  57.     3 FORMAT(2H E)         
  58.       STOP                 
  59.       END                  
  60.                            
  61. ----------------------  
  62.                             
  63.       PROGRAM BM5           
  64.       WRITE(3,1)            
  65.     1 FORMAT(9H Start BM5)        
  66.       K=0                   
  67.     2 K=K+1                 
  68.       A=K/2*3+4-5           
  69.       CALL GOSUB            
  70.       IF(K.LT.1000)GOTO 2   
  71.       WRITE(3,3)            
  72.     3 FORMAT(2H E)          
  73.       STOP                  
  74.       END                   
  75.                                                        
  76. ----------------------  
  77.  
  78.       PROGRAM BM6        
  79.       DIMENSION M(5)     
  80.       WRITE(3,1)         
  81.     1 FORMAT(9H Start BM6)     
  82.       K=0                
  83.     2 K=K+1              
  84.       CALL GOSUB         
  85.       DO 4 L=1,5
  86.     4 CONTINUE           
  87.       IF(K.LT.1000)GOTO 2
  88.       WRITE(3,3)         
  89.     3 FORMAT(2H E)       
  90.       STOP               
  91.       END                
  92.  
  93. ---------------------
  94.  
  95.       PROGRAM BM7            
  96.       DIMENSION M(5)         
  97.       WRITE(3,1)             
  98.     1 FORMAT(9H Start BM7)         
  99.       K=0                    
  100.       K=K+1                  
  101.       A=K/2*3+4-5            
  102.       CALL GOSUB             
  103.       DO 3 L=1,5             
  104.       M(L)=A                 
  105.     4 CONTINUE               
  106.       IF(K.LT.1000)GOTO 2    
  107.       WRITE(3,3)             
  108.     3 FORMAT(2H E)           
  109.       STOP                 
  110.       END                  
  111.                            
  112.       SUBROUTINE GOSUB        
  113.       RETURN              
  114.       END                 
  115.                                  
  116. ----------------------  
  117.  
  118.       PROGRAM BM8           
  119.       WRITE(3,1)            
  120.    1  FORMAT(9H Start BM8)        
  121.       K=0                   
  122.    2  K=K+1                 
  123.       A=K**2                
  124.       FK=K                  
  125.       B=ALOG(FK)            
  126.       C=SIN(FK)             
  127.       IF(K.LT.101)GOTO 2    
  128.       WRITE(3,3)            
  129.    3  FORMAT(2H E)          
  130.       STOP                  
  131.       END                   
  132.                             
  133. ----------------------  
  134.  
  135.       PROGRAM BM9       
  136.       WRITE(3,1)        
  137.     1 FORMAT(9H Start BM9)    
  138.       DO 2 N=1,1000     
  139.       DO 3 K=2,500      
  140.       FN=N              
  141.       FM=FN/K    PP     
  142.       L=INT(FM)         
  143.       IF(L .EQ.0)GOTO 4
  144.       IF(L .EQ.1)GOTO 3     
  145.       IF(FM.GT.L)GOTO 3     
  146.       IF(FM.EQ.L)GOTO 2     
  147.     3 CONTINUE              
  148.     4 WRITE(3,6) N          
  149.     6 FORMAT(1H ,I3)        
  150.     2 CONTINUE              
  151.       WRITE(3,7)            
  152.     7 FORMAT(2H E)          
  153.       STOP                  
  154.       END                   
  155.  
  156. -------------------- 
  157.