<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Your program uses the in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Wrong-output-of-a-simple-real-number/m-p/978101#M99069</link>
    <description>&lt;P&gt;Your program uses the variable &lt;STRONG&gt;a&lt;/STRONG&gt; before it has been initialized with a value. Therefore, the program may print any value and you may not complain about it.&lt;/P&gt;
&lt;P&gt;If, however, you meant to assign 0.025 to&amp;nbsp;&lt;STRONG&gt;a&lt;/STRONG&gt; before using the value, your question is a Frequently Asked Question. A short answer is that most floating point numbers (including, in particular, numbers with simple &lt;EM&gt;decimal&lt;/EM&gt; representations, such as 0.1) do not have exact machine representations, and small errors of the magnitudes that you noticed are to be expected. For more details, you may consult, among others,&amp;nbsp;&lt;A href="http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html"&gt;http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;</description>
    <pubDate>Fri, 08 Nov 2013 15:41:00 GMT</pubDate>
    <dc:creator>mecej4</dc:creator>
    <dc:date>2013-11-08T15:41:00Z</dc:date>
    <item>
      <title>Wrong output of a simple real number</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Wrong-output-of-a-simple-real-number/m-p/978100#M99068</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I'm havin trouble with the outcome of the following most simple FORTRAN programm:&lt;/P&gt;
&lt;P&gt;[fortran]program main&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;implicit none&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;real :: a&lt;/P&gt;
&lt;P&gt;a=3.*a&lt;/P&gt;
&lt;P&gt;write(*,*)a&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;end program main[/fortran]&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;the output in the terminal is 7.5000003E-02 instead of the the correct value. I have also tried compiling with double precision with the -r8 command, resulting in a 1 at the end of the output. Furthermore the problem does occur with other simple calculations as long as the multiplied number is of magnitude less than 10⁻2.&lt;/P&gt;
&lt;P&gt;I have also tried different version of the Intel composer suit and different computers with Ubuntu or Scientific Linux. &lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2013 13:35:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Wrong-output-of-a-simple-real-number/m-p/978100#M99068</guid>
      <dc:creator>Marius_Z_</dc:creator>
      <dc:date>2013-11-08T13:35:27Z</dc:date>
    </item>
    <item>
      <title>Your program uses the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Wrong-output-of-a-simple-real-number/m-p/978101#M99069</link>
      <description>&lt;P&gt;Your program uses the variable &lt;STRONG&gt;a&lt;/STRONG&gt; before it has been initialized with a value. Therefore, the program may print any value and you may not complain about it.&lt;/P&gt;
&lt;P&gt;If, however, you meant to assign 0.025 to&amp;nbsp;&lt;STRONG&gt;a&lt;/STRONG&gt; before using the value, your question is a Frequently Asked Question. A short answer is that most floating point numbers (including, in particular, numbers with simple &lt;EM&gt;decimal&lt;/EM&gt; representations, such as 0.1) do not have exact machine representations, and small errors of the magnitudes that you noticed are to be expected. For more details, you may consult, among others,&amp;nbsp;&lt;A href="http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html"&gt;http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2013 15:41:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Wrong-output-of-a-simple-real-number/m-p/978101#M99069</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2013-11-08T15:41:00Z</dc:date>
    </item>
  </channel>
</rss>

