<?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: Rounding Question in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851461#M66101</link>
    <description>Yes - we have not yet documented all the Fortran 2003 features we support. We'll address that in the next major release.</description>
    <pubDate>Thu, 22 Apr 2010 14:07:37 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2010-04-22T14:07:37Z</dc:date>
    <item>
      <title>Rounding Question</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851429#M66069</link>
      <description>&lt;P&gt;Hello:&lt;/P&gt;
&lt;P&gt;I have a simple program that consists of the following 3 lines of code:&lt;/P&gt;&lt;PRE&gt;&lt;FONT size="2"&gt;&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;B&gt;&lt;FONT color="#0000ff" size="2"&gt;double precision&lt;/FONT&gt;&lt;/B&gt;&lt;FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt; :: temp&lt;P&gt;&lt;/P&gt;&lt;P&gt;temp = 0.0625&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;B&gt;&lt;FONT color="#0000ff" size="2"&gt;write&lt;/FONT&gt;&lt;/B&gt;&lt;FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;(6, '(F10.3)') temp&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;When I compile (using compiler version 10.1.014) the code in Debug mode and run it,it writes out the number 0.062. But when I use Release mode I get a result of 0.063.&lt;/P&gt;
&lt;P&gt;Why is there a difference?&lt;/P&gt;
&lt;P&gt;Thanks.&lt;BR /&gt;Michael&lt;/P&gt;&lt;PRE&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Feb 2008 20:21:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851429#M66069</guid>
      <dc:creator>Michael8</dc:creator>
      <dc:date>2008-02-12T20:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding Question</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851430#M66070</link>
      <description>I can't reproduce this. I get 0.063 in both cases.&lt;BR /&gt;</description>
      <pubDate>Tue, 12 Feb 2008 20:49:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851430#M66070</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2008-02-12T20:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding Question</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851431#M66071</link>
      <description>Curiously, I might have expected .062 as this matches the IEEE "round to even" rule. How the F format rounds is unspecified by Fortran 95. Fortran 2003 allows user control over rounding, but the default choice is left implementation-dependent. Intel Fortran does not yet support the user-controlled rounding features.&lt;BR /&gt;</description>
      <pubDate>Tue, 12 Feb 2008 20:57:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851431#M66071</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2008-02-12T20:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding Question</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851432#M66072</link>
      <description>&lt;P&gt;Thanks for looking into this. That's interesting that you can't reproduce it. I'm attaching a zip file with the solution file, project file, and source code file.&lt;/P&gt;
&lt;P&gt;This zip file comes form my co-worker's computer, and he is the one actually running version 10.1.014. I'm actually running 9.1.039. The results I posted in my first post were really from my run. We noticed for him, though, the results are flipped (0.062 in Release mode and 0.063 in Debug mode).&lt;/P&gt;
&lt;P&gt;I'm curious to see if you can reproduce the problem with the attached zip file.&lt;/P&gt;
&lt;P&gt;Thanks.&lt;BR /&gt;Michael&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2008 21:18:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851432#M66072</guid>
      <dc:creator>Michael8</dc:creator>
      <dc:date>2008-02-12T21:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding Question</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851433#M66073</link>
      <description>&lt;P&gt;What if you write temp as&lt;/P&gt;
&lt;P&gt;temp =0.0625d0&lt;/P&gt;
&lt;P&gt;?&lt;/P&gt;
&lt;P&gt;Gerry&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2008 21:44:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851433#M66073</guid>
      <dc:creator>g_f_thomas</dc:creator>
      <dc:date>2008-02-12T21:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding Question</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851434#M66074</link>
      <description>The ZIP is password-protected.&lt;BR /&gt;</description>
      <pubDate>Tue, 12 Feb 2008 22:01:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851434#M66074</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2008-02-12T22:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding Question</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851435#M66075</link>
      <description>The password is "ssa".&lt;BR /&gt;</description>
      <pubDate>Tue, 12 Feb 2008 22:29:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851435#M66075</guid>
      <dc:creator>michael84</dc:creator>
      <dc:date>2008-02-12T22:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding Question</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851436#M66076</link>
      <description>&lt;P&gt;Really? I didn't know it had password protection until Steve told me, I'm not familiar enough with my zip to know how to password an archive. But if' 'ssa' works then good but I appear to be able to expand it no problem and without being privy to the pswd.&lt;/P&gt;
&lt;P&gt;Gerry&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2008 22:52:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851436#M66076</guid>
      <dc:creator>g_f_thomas</dc:creator>
      <dc:date>2008-02-12T22:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding Question</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851437#M66077</link>
      <description>Could you actually extract the files, Gerry? I couldn't.&lt;BR /&gt;&lt;BR /&gt;I get .063 in both Debug and Release modes with this project.&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Feb 2008 00:19:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851437#M66077</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2008-02-13T00:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding Question</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851438#M66078</link>
      <description>IEEE round to even default, and Fortran user controlled rounding, apply
only in binary mode, as far as I can tell from references. In the case
posed, 0.0625 is representable exactly in both single (as specified)
and double precision, so the range of possible "problems" is limited,
even though this small case involves conversion from decimal to single
precision binary, to double precision binary, and then to decimal
again. The issue of passing through single precision representation
could be removed, as previously suggested, but that will make no
difference here, since no roundoff is involved.&lt;BR /&gt;
The question asked pertains to conversion from binary to
decimal, without enough places allowed to recover the exact decimal
value. If you allow enough places, the IEEE rules require
0.06250000... to be displayed, with a tolerance of plus/minus
0.47*temp*epsilon(temp), if I remember correctly.</description>
      <pubDate>Wed, 13 Feb 2008 00:48:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851438#M66078</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2008-02-13T00:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding Question</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851439#M66079</link>
      <description>&lt;P&gt;Steve, I think we have cossed threads here. Yes, when I click on the link I can open it on your server without downloading it. Did the 'ssa' password work? I'll rezip it with a different zip tool and see if that works.&lt;/P&gt;
&lt;P&gt;Gerry&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2008 00:58:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851439#M66079</guid>
      <dc:creator>g_f_thomas</dc:creator>
      <dc:date>2008-02-13T00:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding Question</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851440#M66080</link>
      <description>Gerry, I was referring to Michael's zip, not yours.&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Feb 2008 11:48:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851440#M66080</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2008-02-13T11:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding Question</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851441#M66081</link>
      <description>&lt;P&gt;Sorry about the password. When my co-worker (Michael84) emailed the zip file to me, he had to password protect it to get it through our email system filter. Then I forgot to take off the encryption before posting it.&lt;/P&gt;
&lt;P&gt;Gerry, I forgot the "d0" at the end, but adding this makes no dfifference. As Tim pointed out, there's no rounding issue here becuase 0.0625 should be exactly representable as either single precision of double precision.&lt;/P&gt;
&lt;P&gt;Thanks everyone for looking into this. I'm not sure why you can't reproduce it.&lt;/P&gt;
&lt;P&gt;I noticed also that similar inconsistencies occur with other numbers that are negative powers of 2, such as 0.03125 and 0.015625. But it didn't happen with 0.5, 0.25, or 0.125. (These I've tested on my computer, using version 9.1.039.)&lt;/P&gt;
&lt;P&gt;Thanks.&lt;BR /&gt;Michael&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2008 13:35:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851441#M66081</guid>
      <dc:creator>Michael8</dc:creator>
      <dc:date>2008-02-13T13:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding Question</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851442#M66082</link>
      <description>Either .062 or .063 is an acceptable answer. It all depends on what rounding method is in use. In IEEE floating arithmetic, if a value is exactly halfway between two representable values, the rounding is done so that the last digit is even and not odd. So .062 would follw for that. On VAX systems, as a counter-example, rounding is "away from zero", so .063 would be correct.&lt;BR /&gt;&lt;BR /&gt;The only place that the Fortran standard explicitly calls out the rounding method is for the NINT intrinsic, in which rounding away from zero is specified. I had thought that the compiler used IEEE rules for formatted output, so I don't quite understand what is happening here. I'll ask the developers familiar with the code to see what should be expected.&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Feb 2008 14:31:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851442#M66082</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2008-02-13T14:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding Question</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851443#M66083</link>
      <description>&lt;P&gt;I agree that either 0.062 or 0.063 is acceptable -- I don't really care which onegets output. I'm just trying to figure out why Release and Debug mode are giving different answers. It's making some of our validation more painful.&lt;/P&gt;
&lt;P&gt;Furthermore, although I can't reproduce it today, yesterday I was even getting inconsistent results justwithin Debug mode depending on whether or not I had an extra, unrelated, write statement in my program.&lt;/P&gt;
&lt;P&gt;Thanks for checking with the developers on this matter.&lt;/P&gt;
&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2008 15:58:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851443#M66083</guid>
      <dc:creator>Michael8</dc:creator>
      <dc:date>2008-02-13T15:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding Question</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851444#M66084</link>
      <description>Sounds as if you may have an uninitialized variable or out of bounds array access in your program.&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Feb 2008 16:13:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851444#M66084</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2008-02-13T16:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding Question</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851445#M66085</link>
      <description>&lt;P&gt;Actually,I wasusing that test program, exactly as I sent it to you. So there are no uninitialized variables or arrays out of bounds. The only thing I added was an extra write statement (that printed out the variable with more precision), and this caused the results of the first write statement to change.&lt;/P&gt;
&lt;P&gt;Thanks&lt;BR /&gt;Michael&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2008 16:44:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851445#M66085</guid>
      <dc:creator>Michael8</dc:creator>
      <dc:date>2008-02-13T16:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding Question</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851446#M66086</link>
      <description>I found a way to reproduce the problem. If I link /libs:dll, I get .062. Let me look into this some more.&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Feb 2008 17:28:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851446#M66086</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2008-02-13T17:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding Question</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851447#M66087</link>
      <description>&lt;P&gt;Default floating point speculation goes from safe to fast in going from debug to release configurations. Check what happens if they are the same.&lt;/P&gt;
&lt;P&gt;Gerry&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2008 02:11:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851447#M66087</guid>
      <dc:creator>g_f_thomas</dc:creator>
      <dc:date>2008-02-14T02:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding Question</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851448#M66088</link>
      <description>&lt;P&gt;Thanks for your suggestion, Gerry.&lt;/P&gt;
&lt;P&gt;I see, using the Visual Studio IDE, that the floating point speculation changes between Debug and Release; however it is grayed out and does not let me change it. Looking at the "Command Line" (in the IDE Propery Pages), there appears to be no Qfp option at all in either configuration.&lt;/P&gt;
&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2008 17:13:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Rounding-Question/m-p/851448#M66088</guid>
      <dc:creator>Michael8</dc:creator>
      <dc:date>2008-02-14T17:13:08Z</dc:date>
    </item>
  </channel>
</rss>

