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!

Is SQRT has bug?

billpeace
Beginner
93 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
93 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?

 

 

mecej4
Black Belt
93 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.

Reply