<?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 Double precision variable initialization in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Double-precision-variable-initialization/m-p/819065#M46713</link>
    <description>In Fortran, items on the right side of an assignment are evaluated without knowledge of what the type on the left side is. In the days before Fortran 90, it was common for compilers to keep constants in the highest available precision and convert down only when required, but Fortran 90 established the concept that constants had a "kind" and if you don't use a kind specifier or an E/D exponent, you get "default real".&lt;BR /&gt;&lt;BR /&gt;Intel Fortran also has a /fpconstant switch which may be closer to what you want - it keeps floating point constant in the higher precision.</description>
    <pubDate>Sat, 21 May 2011 14:49:32 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2011-05-21T14:49:32Z</dc:date>
    <item>
      <title>Double precision variable initialization</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Double-precision-variable-initialization/m-p/819061#M46709</link>
      <description>Dears,&lt;BR /&gt;&lt;BR /&gt;Maybe you know the compiler switch that would do a full double precision variable initialization without inserting d0 after every number. I mean when I do:&lt;BR /&gt;&lt;BR /&gt;program test&lt;BR /&gt; real*8 i&lt;BR /&gt; do i=0.1, 1, 0.1&lt;BR /&gt;  print *,i&lt;BR /&gt; end do&lt;BR /&gt; pause&lt;BR /&gt;endprogram&lt;BR /&gt;&lt;BR /&gt;the output is&lt;BR /&gt;0.100000001490116&lt;BR /&gt;0.200000002980232&lt;BR /&gt;0.300000004470348&lt;BR /&gt;0.400000005960464&lt;BR /&gt;0.500000007450581&lt;BR /&gt;0.600000008940697&lt;BR /&gt;0.700000010430813&lt;BR /&gt;0.800000011920929&lt;BR /&gt;0.900000013411045&lt;BR /&gt;&lt;BR /&gt;And if my modify:&lt;BR /&gt;&lt;BR /&gt;program test&lt;BR /&gt; real*8 i&lt;BR /&gt; do i=0.1d0, 1d0, 0.1d0&lt;BR /&gt;  print *,i&lt;BR /&gt; end do&lt;BR /&gt; pause&lt;BR /&gt;endprogram&lt;BR /&gt;&lt;BR /&gt;I get&lt;BR /&gt;0.100000000000000&lt;BR /&gt;0.200000000000000&lt;BR /&gt;0.300000000000000&lt;BR /&gt;0.400000000000000&lt;BR /&gt;0.500000000000000&lt;BR /&gt;0.600000000000000&lt;BR /&gt;0.700000000000000&lt;BR /&gt;0.800000000000000&lt;BR /&gt;0.900000000000000&lt;BR /&gt;1.00000000000000&lt;BR /&gt;&lt;BR /&gt;I would like that if I initialize the double precision variable it is always initialized at its full precision not single. Always using the d0 symbols makes the loops less readable and so error prone.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;Maciej&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 20 May 2011 19:21:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Double-precision-variable-initialization/m-p/819061#M46709</guid>
      <dc:creator>maciej</dc:creator>
      <dc:date>2011-05-20T19:21:00Z</dc:date>
    </item>
    <item>
      <title>Double precision variable initialization</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Double-precision-variable-initialization/m-p/819062#M46710</link>
      <description>"Always using the d0 symbols makes the loops less readable and so error prone."&lt;BR /&gt;&lt;BR /&gt;But using them is more standard and will work with all compilers.&lt;BR /&gt;&lt;BR /&gt;You may be looking for the /real:64 switch.&lt;BR /&gt;&lt;BR /&gt;Linda&lt;BR /&gt;</description>
      <pubDate>Fri, 20 May 2011 19:34:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Double-precision-variable-initialization/m-p/819062#M46710</guid>
      <dc:creator>lklawrie</dc:creator>
      <dc:date>2011-05-20T19:34:44Z</dc:date>
    </item>
    <item>
      <title>Double precision variable initialization</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Double-precision-variable-initialization/m-p/819063#M46711</link>
      <description>And it's less error prone to require a switch to give the meaning you want? I am very strongly in favor of expressing in the source exactly what you mean, and not relying on something external to the source such as a switch.&lt;BR /&gt;&lt;BR /&gt;Also, using a non-integer variable as a DO loop control variable is a "deleted feature" and prone to many problems.&lt;BR /&gt;&lt;BR /&gt;I suggest you take advantage of modern Fortran and do it as I see many do:&lt;BR /&gt;&lt;BR /&gt;program test&lt;BR /&gt; integer, parameter :: DP = selected_real_kind(15,300)&lt;BR /&gt; real(DP) x&lt;BR /&gt; integer i&lt;BR /&gt; x = 0.1_DP&lt;BR /&gt; do i=1,10&lt;BR /&gt;  print *,x&lt;BR /&gt; x = x + 0.1_DP&lt;BR /&gt; end do&lt;BR /&gt; pause&lt;BR /&gt;endprogram&lt;BR /&gt;&lt;BR /&gt;Of course, you should also understand that 0.1 is not exactly representable in binary floating point.&lt;BR /&gt;&lt;BR /&gt;If you insist on hiding your intentions from the reader of your code, the switch you are looking for is /real_size:64.</description>
      <pubDate>Fri, 20 May 2011 19:38:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Double-precision-variable-initialization/m-p/819063#M46711</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-05-20T19:38:14Z</dc:date>
    </item>
    <item>
      <title>Double precision variable initialization</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Double-precision-variable-initialization/m-p/819064#M46712</link>
      <description>&lt;P&gt;Thank you  I will use a switch as propably noone will use
my code later. And yes, for me the notation with D is less readable in the code
 but it is only my experience. In fact I created that forum thread after
making notoriuos errors with this. It simply slows down my creating process :)&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;

&lt;P&gt;So I was always wondering why is that Fortrans feature for.
I dont know why Fortran specifications assumes that I dont want to use full
precision of variable if I process it with some constant values. I understand,
that if I intentionally wanted that behaviour I should use a D or E. But default
should work with precision selected by programmer on the stage of declaration.
I know it is probably some specification since ancient times kept for backward
compatibility.&lt;/P&gt;

&lt;P&gt;These are just my thoughts only. But such a flowers always
causes me thinking to try IMSL with Visual Basic NET (I am still very impressed
of how much VB NET is a programmer friendly language). And I see there is an edition of
IMSL 7 for C#/VB NET :)&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards and thanks,&lt;/P&gt;&lt;P&gt;Maciej&lt;/P&gt;</description>
      <pubDate>Sat, 21 May 2011 12:59:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Double-precision-variable-initialization/m-p/819064#M46712</guid>
      <dc:creator>maciej</dc:creator>
      <dc:date>2011-05-21T12:59:26Z</dc:date>
    </item>
    <item>
      <title>Double precision variable initialization</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Double-precision-variable-initialization/m-p/819065#M46713</link>
      <description>In Fortran, items on the right side of an assignment are evaluated without knowledge of what the type on the left side is. In the days before Fortran 90, it was common for compilers to keep constants in the highest available precision and convert down only when required, but Fortran 90 established the concept that constants had a "kind" and if you don't use a kind specifier or an E/D exponent, you get "default real".&lt;BR /&gt;&lt;BR /&gt;Intel Fortran also has a /fpconstant switch which may be closer to what you want - it keeps floating point constant in the higher precision.</description>
      <pubDate>Sat, 21 May 2011 14:49:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Double-precision-variable-initialization/m-p/819065#M46713</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-05-21T14:49:32Z</dc:date>
    </item>
    <item>
      <title>Double precision variable initialization</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Double-precision-variable-initialization/m-p/819066#M46714</link>
      <description>&lt;I&gt;&amp;gt;I dont know why Fortran specifications assumes that I dont want to use full
precision of variable if I process it with some constant values.&lt;/I&gt;&lt;BR /&gt;&lt;I&gt;&lt;BR /&gt;&lt;/I&gt;It makes no such assumption. Variables in expressions have the types that they were declared with, but these &lt;SPAN style="text-decoration: underline;"&gt;declarations do not cover constants&lt;/SPAN&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;I&gt;&amp;gt; But default
should work with precision selected by programmer on the stage of declaration.&lt;BR /&gt;&lt;BR /&gt;&lt;/I&gt;Declarations of &lt;SPAN style="text-decoration: underline;"&gt;variables&lt;/SPAN&gt; (whether explicit or implicit) do not affect the types of &lt;SPAN style="text-decoration: underline;"&gt;constants&lt;/SPAN&gt; used in expressions. Expressions can be mixed mode, i.e., be made up of parts of different types and kinds.&lt;BR /&gt;&lt;BR /&gt;&lt;I&gt;&amp;gt; I know it is probably some specification since ancient times kept for backward
compatibility.&lt;BR /&gt;&lt;BR /&gt;&lt;/I&gt;("I know" does not go well with "probably".) Although Fortran is an old language and backward compatibility may be more prized in it more than in other languages, useless and harmful features do get revised or dropped when the language is revised.&lt;BR /&gt;&lt;BR /&gt;&lt;I&gt;&amp;gt; But such a flowers always
causes me thinking to try IMSL with Visual Basic NET&lt;BR /&gt;&lt;BR /&gt;&lt;/I&gt;The grass is greener over the septic tank. For most people, language selection depends on more attributes than just flowers&lt;I&gt;.&lt;/I&gt;</description>
      <pubDate>Sat, 21 May 2011 15:36:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Double-precision-variable-initialization/m-p/819066#M46714</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2011-05-21T15:36:08Z</dc:date>
    </item>
    <item>
      <title>Double precision variable initialization</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Double-precision-variable-initialization/m-p/819067#M46715</link>
      <description>&lt;P&gt;Thank to all of you for the explanations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Dear mecej4, I was certainly not clear enough. I provided
sample code which shows what behavior I meant. &lt;/P&gt;

&lt;P&gt;In my opinion the first code should give the same results as
the second. I know that it doesnt and I have to obey the rule of this
language. I wanted only to know an easier way to increase my programming, errors-free efficiency.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Best regards,&lt;/P&gt;

&lt;P&gt;Maciej&lt;/P&gt;</description>
      <pubDate>Sat, 21 May 2011 18:26:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Double-precision-variable-initialization/m-p/819067#M46715</guid>
      <dc:creator>maciej</dc:creator>
      <dc:date>2011-05-21T18:26:23Z</dc:date>
    </item>
  </channel>
</rss>

