<?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 Re: Problem with REAL's in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-REAL-s/m-p/762168#M17655</link>
    <description>This is in addition to bpichon said.&lt;BR /&gt;&lt;BR /&gt;Not all rational numbers (like 0.05) have exact representations in a finite number of bits.  As an analogy, how many decimal places does it take to exactly represent 1/7?&lt;BR /&gt;&lt;BR /&gt;Delve into the documentation, looking for the way real numbers are approximated in floating point.</description>
    <pubDate>Mon, 03 Oct 2005 21:15:08 GMT</pubDate>
    <dc:creator>emc-nyc</dc:creator>
    <dc:date>2005-10-03T21:15:08Z</dc:date>
    <item>
      <title>Problem with REAL's</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-REAL-s/m-p/762166#M17653</link>
      <description>I have a problem with floating point values/real's:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;program vartest&lt;BR /&gt;&lt;BR /&gt;implicit none&lt;BR /&gt;DOUBLE PRECISION :: w,x,z&lt;BR /&gt;REAL :: y&lt;BR /&gt;&lt;BR /&gt;w = 0.05&lt;BR /&gt;x = 0.05000000000000000000000&lt;BR /&gt;y = 0.05&lt;BR /&gt;z = sqrt(2.0)&lt;BR /&gt;&lt;BR /&gt;write(*,*) w&lt;BR /&gt;write(*,*) x&lt;BR /&gt;write(*,*) y&lt;BR /&gt;write(*,*) z&lt;BR /&gt;&lt;BR /&gt;end program vartest&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Gives:&lt;BR /&gt;  5.000000074505806E-002&lt;BR /&gt;  5.000000074505806E-002&lt;BR /&gt;  5.0000001E-02&lt;BR /&gt;   1.41421353816986&lt;BR /&gt;&lt;BR /&gt;Why doesn't it gives: 0.05 exactly, but a small variation to it? And the value of the root of 2 also has small difference to the value on my handheld calculator.</description>
      <pubDate>Mon, 03 Oct 2005 20:38:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-REAL-s/m-p/762166#M17653</guid>
      <dc:creator>paul321</dc:creator>
      <dc:date>2005-10-03T20:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with REAL's</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-REAL-s/m-p/762167#M17654</link>
      <description>&lt;P&gt;Sorry BUT, first, learnFortran !!!!&lt;/P&gt;
&lt;P&gt;You write : 0.05 is a single precision constant&lt;/P&gt;
&lt;P&gt;This is correct : 0.05d0 for a double precision constant&lt;/P&gt;
&lt;P&gt;In the same spirit SQRT(2.0) is computed in single precision&lt;/P&gt;
&lt;P&gt;but SQRT(2.D0) is computed in double precision.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 03 Oct 2005 20:49:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-REAL-s/m-p/762167#M17654</guid>
      <dc:creator>bpichon</dc:creator>
      <dc:date>2005-10-03T20:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with REAL's</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-REAL-s/m-p/762168#M17655</link>
      <description>This is in addition to bpichon said.&lt;BR /&gt;&lt;BR /&gt;Not all rational numbers (like 0.05) have exact representations in a finite number of bits.  As an analogy, how many decimal places does it take to exactly represent 1/7?&lt;BR /&gt;&lt;BR /&gt;Delve into the documentation, looking for the way real numbers are approximated in floating point.</description>
      <pubDate>Mon, 03 Oct 2005 21:15:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-REAL-s/m-p/762168#M17655</guid>
      <dc:creator>emc-nyc</dc:creator>
      <dc:date>2005-10-03T21:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with REAL's</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-REAL-s/m-p/762169#M17656</link>
      <description>Thanks!&lt;BR /&gt;This isn't explicitly explained in the Fortran book I have.</description>
      <pubDate>Mon, 03 Oct 2005 23:02:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-REAL-s/m-p/762169#M17656</guid>
      <dc:creator>paul321</dc:creator>
      <dc:date>2005-10-03T23:02:26Z</dc:date>
    </item>
  </channel>
</rss>

