Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
16 Views

Bug of the division with quadruple precision complex

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
Highlighted
Beginner
16 Views

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

0 Kudos