Advertisement
Guest User

Untitled

a guest
Dec 18th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. real*16 function myexp(x)
  3.     implicit none
  4.     real*16, intent(in) :: x
  5.     integer :: i
  6.     real*16 :: tmp
  7.     tmp = 0
  8.     if(x == 0) then
  9.         myexp = 1
  10.         return
  11.     end if
  12.  
  13.     do i=350,1,-1
  14.         tmp = i*x/(i+1+x-tmp)
  15.     end do
  16.  
  17.     tmp = x/(1+x-tmp)
  18.     tmp = 1/(1-tmp)
  19.     myexp = tmp
  20. end function myexp
  21.  
  22. program gobuhat
  23.     implicit none
  24.     real*16 :: pwr
  25.     interface
  26.         real*16 function myexp(x)
  27.             real*16, intent(in) :: x
  28.         end function myexp
  29.     end interface
  30.  
  31.     read (*, *) pwr
  32.     print *, myexp(pwr)
  33. end program
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement