File:  [Power 6/32 Unix Tahoe 4.2BSD] / cci / usr / src / usr.bin / f77 / f77pass1 / tst / t11.f
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Sun Jul 28 12:26:07 2019 UTC (7 years ago) by root
Branches: bsd, MAIN
CVS tags: v121, HEAD
Power 6/32 Unix version 1.21

c	subroutine tst11
	parameter(ntest=11)
c	Calls

	integer ack
	if ( ack(2,2) .ne. 7 ) call e(1,ntest)
	if ( ack(3,3) .ne. 61 ) call e(2,ntest)
	if ( ack(3,5) .ne. 253 ) call e(3,ntest)
	if ( ack(2,100) .ne. 203 ) call e(4,ntest)
	call fib0(10,i)
	if ( i .ne. 55 ) call e(5,ntest)
	call fib(15,i)
	if ( i .ne. 610 ) call e(6,ntest)
	call fib(20,i)
	if ( i .ne. 6765 ) call e(7,ntest)
	end

	integer function ack(m,n)
	if ( m.eq.0 )goto 1
	if ( n.eq.0 )goto 2
	ack = ack(m-1,ack(m,n-1))
	return
1	ack = n+1
	return
2	ack = ack(m-1,1)
	end

	subroutine fib0(a, b)
c	Fibonacci nrs
	integer a,b,f0,f1
	f0=1
	f1=1
	i=2
	entry fib(a, b)
	do 4 j=i+1,a
	b=f0+f1
	f0=f1
	f1=b
4	continue
	i=a
	end

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.