function fact4(k)
real(4) fact4

fact4 =1.0
if(k.eq.0) return
do i =2,k
fact4 =fact4*real(i)
enddo

end function fact4
!------------------------
function fact8(k)
real(8) fact8

fact8=1D0
if(k.eq.0) return
do i =2,k
fact8 =fact8*dble(i)
enddo

end function fact8
!--------------------------
function fact16(k)
real(16) fact16

fact16 =1q0
if(k.eq.0) return
do i =2,k
fact16 =fact16*real(i)
enddo

end function fact16
!--------------------------

