Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26758 Discussions

Bug of the division with quadruple precision complex

kawai__masatoshi
Beginner
108 Views

Dear all

I noticed a bug of division with quadruple precision complex.
A version of compiler is 18.0.2.199. And the compiler option is nothing.

Following is the sample program.

program main
  implicit none
  complex(16) alpha
  real(16) beta, gamma

  alpha = cmplx(huge(gamma), huge(gamma), 16)
  beta = huge(gamma)
  gamma = 1.0Q+1

  write(*, *) alpha, beta, gamma
  write(*, *) alpha/gamma, beta/gamma

end program main

Following is an execution result.
(1.189731495357231765085759326628007E+4932, 1.189731495357231765085759326628007E+4932)
  1.189731495357231765085759326628007E+4932   10.0000000000000000000000000000000
(Infinity,Infinity)  1.189731495357231765085759326628007E+4931

The result of dividing complex was "infinity".
If the number to be divided is far from huge() value, the result was collect.

0 Kudos
1 Reply
Navdeep_Rana
Beginner
108 Views

Works with gfortran, ifort reproduces your output. Might be a bug.

Reply