program test_xp
	! vypocet integralu E(n) pomoci rekurentni formule
	! E(n) = 1 - n*E(n-1), n = 2,3,4,...
	! E(1) = 1/e
	! pri zadanem poctu dekadickych cifer

	use std_type
	use VstupVystup
	use xp_module

	implicit none

	real(DP) :: xr,clen1
	type(xp_real) :: x, clen, jedna
	integer :: cifer,n,clenu
	
	call cti_cislo("Zadej pocet platnych cifer ",cifer)
	call cti_cislo("Zadej pocet iteracnich clenu ",clenu)
	
	JBASE = 10
	NDIG = cifer
	JFORM1 = 2				! vystup v f formatu
	JFORM2 = NDIG+10		! pocet cifer za desetinou teckou
	
	! E(1) = 1/e
	jedna = 1.0
	clen = 1.0/2.718281828
	n = 1
	do
		print *,n
		if (n>1) clen = jedna - n*clen
		call xp_print(clen)
		n=n+1
		if (n>clenu) exit
	end do
	
	read *
	
	

end program test_xp
