Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

loop with integer to real qp Internal compiler error

$
0
0

Hi ,

I have internal compiler error with the following code, trying to convert from int to quadruple precision inside a loop with at least -O2 . Compiler version 14.  It works with double precision.

Thanks

program foo
      implicit none
      integer,parameter ::  q =  selected_real_kind(2*precision(1d0))
      real(q) :: k
      integer :: i
      
      do i=1,100
        k=real(i,q)
        print *,factorial1(k)
      end do
      
      contains
            
              function factorial1(n) result(res)
                      real(q) :: n
                      real(q) :: res
                      integer  :: i
                      res=1._q
                      do i=int(n),1,-1
                        res=res*i
                      end do
              end function factorial1

end program foo 

 


Viewing all articles
Browse latest Browse all 3270

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>