Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Is SQRT has bug?

billpeace
Beginner
696 Views

           

             tempA= SQRT (VK (IJ, Q) **2 + UK (IJ, Q) **2)
             tempA= SQRT (VK (IJ, Q) **2 + UK (IJ, Q) **2)
            TAU0= tempA / SLEN (IJ) * MAX (SMALL, VISLAM) 
            result :  tempA = 0D0   TAU0 = 0D0

           but when  

            tempA= SQRT (VK (IJ, Q) **2 + UK (IJ, Q) **2)
            TAU0= tempA / SLEN (IJ) * MAX (SMALL, VISLAM) 
             result :  tempA = NaN   TAU0 = NaN

 

           WHY?
 

0 Kudos
2 Replies
billpeace
Beginner
696 Views

            tempB = 0.0D+0
            tempA = SQRT(tempB)
            result :  tempA = NaN

        but when  

             tempB = 0.0D+0
            tempA = SQRT(tempB)
            tempA = SQRT(tempB)
            result :  tempA = 0.0D+0

   compiler: ifort 
   source file : f90

   Why?

 

 

0 Kudos
mecej4
Honored Contributor III
696 Views

Your question is too ambiguous and lacking in detail to elicit a useful answer.

You have to present a complete short program with declarations for the variables and output statements for the variables whose values you wish to display.

Finally, you should state which compiler version was used, which operating system the compiler ran under, and which compiler options were used.

0 Kudos
Reply