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

Is SQRT has bug?

           

             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
Highlighted
Beginner
17 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
Highlighted
Black Belt
17 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