<meta http-equiv="Content-Type" content="text/html; charset=GB18030"><div><p style="margin-bottom: 0in; line-height: 16px; background-color: transparent;">Hello everyone,</p><p style="margin-bottom: 0in; line-height: 16px; background-color: transparent;">I found some questionable behaviors in the clang compiler.</p><p style="margin-bottom: 0in; line-height: 16px; background-color: transparent;">I tried to calculate the smallest number in my machine with clang. I did it by looping as: </p><p style="margin-bottom: 0in; line-height: 16px; background-color: transparent;">a = a / 1.73</p><p style="margin-bottom: 0in; line-height: 16px; background-color: transparent;">In g++, after 1358 loops, I found that a = 4.94066E-324, and the value of a never changes from loop 1358 till the end 1500 loop.</p><p style="margin-bottom: 0in; line-height: 16px; background-color: transparent;">It is questionable for me that a non zero real number here a = 4.94066E-324 divided by a non zero and non one real number here 1.73 will keep the same value. The phenomenon seems to the qualification of the ground state energy in a quantum system.</p><p style="margin-bottom: 0in; line-height: 16px; background-color: transparent;">Is this bug for the clang compiler?</p><p style="margin-bottom: 0in; line-height: 16px; background-color: transparent;">I tested my code with, g++ (Apple LLVM version 10.0.0, clang-1000.10.44.4) on Macintosh. I also tried a = a / 1.7, a = a / 1.77. </p><p style="margin-bottom: 0in; line-height: 16px; background-color: transparent;">All have similar results. A ground state qualification and unchanged value of a. </p><p style="margin-bottom: 0in; line-height: 16px; background-color: transparent;">I guess that it is related to the binary system used by the computer system. </p><p style="margin-bottom: 0in; line-height: 16px; background-color: transparent;">Here with my codes. </p></div><div><font face="楷体,楷体_GB2312" size="2"><br></font></div><div><font face="楷体,楷体_GB2312" size="2">Best wishes</font></div><div><font face="楷体,楷体_GB2312" size="2">Tianyou Yi</font></div><div><font face="楷体,楷体_GB2312" size="2">Postdoc researcher in National Tsing Hua University</font></div><div><font face="楷体,楷体_GB2312" size="2"><br></font></div><div><hr align="left" style="margin: 0 0 10px 0;border: 0;border-bottom:1px solid #E4E5E6;height:0;line-height:0;font-size:0;padding: 20px 0 0 0;width: 50px;"><div style="font-size:14px;font-family:Verdana;color:#000;"><div><b><font size="1">Best wishes</font></b></div><div><b><font size="1">Tianyou Yi</font></b> <br></div><div>Please send me to </div><div>yitianyoucn@qq.com</div><div>yitianyou9711@gzemail.cn</div><div><br></div><div><br></div>
</div></div><div> </div>