<?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: Integer*8 does not work ???? in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Integer-8-does-not-work/m-p/844802#M62771</link>
    <description>integer*2 multiplies are not promoted to integer*4.  You might be able to come up with a test case that makes it look as if that's happening, but if so, it's accidental.&lt;BR /&gt;&lt;BR /&gt;The standard is quite clear in saying that the kind of the variable on the left side of the assignment is not a factor in evaluating the expression on the right side.  The standard also has clear rules about how expressions are evaluated and when any type conversion is done.&lt;BR /&gt;&lt;BR /&gt;If you had done something like:&lt;BR /&gt;&lt;BR /&gt;i8 = i8 * i4&lt;BR /&gt;&lt;BR /&gt;then a conversion of the i4 to i8 is done before the multiply.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
    <pubDate>Mon, 27 May 2002 02:54:40 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2002-05-27T02:54:40Z</dc:date>
    <item>
      <title>Integer*8 does not work ????</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Integer-8-does-not-work/m-p/844799#M62768</link>
      <description>This subroutine gives wrong results.&lt;BR /&gt;The variables a and b should be able to hold positive inetegers up to 2 billion or so, so the result should be good to 4e+18 or so. None of these ansawers come out right.&lt;BR /&gt;==========================================================&lt;BR /&gt;        subroutine test_i8&lt;BR /&gt;	integer*4 a/1000000000/&lt;BR /&gt;	integer*4 b/1000000000/&lt;BR /&gt;	integer*4 a1,b1&lt;BR /&gt;	integer*8 ab&lt;BR /&gt;	ab=a*b&lt;BR /&gt;	b1=ab/a&lt;BR /&gt;	a1=ab/b&lt;BR /&gt;	print '(1x,a,i20)',"ab=",ab&lt;BR /&gt;	print *,'a1=',a1&lt;BR /&gt;	print *,'b1=',b1&lt;BR /&gt;	end</description>
      <pubDate>Sun, 26 May 2002 14:23:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Integer-8-does-not-work/m-p/844799#M62768</guid>
      <dc:creator>WSinc</dc:creator>
      <dc:date>2002-05-26T14:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: Integer*8 does not work ????</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Integer-8-does-not-work/m-p/844800#M62769</link>
      <description>Your program is incorrect.  When you have:&lt;BR /&gt;&lt;PRE&gt;
ab=a*b
&lt;/PRE&gt;&lt;BR /&gt;the expression a*b is evaluated as INTEGER*4 and overflows.  Because overflow checking is off by default, you get "wrong" results. It does not matter what type ab is - the language rules say that since a and b are each INTEGER*4, that's the type of the result.&lt;BR /&gt;&lt;BR /&gt;One way to fix this is to say instead:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;
ab=int(a,8)*int(b,8)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;This converts a and b to INTEGER*8 before doing the multiplication.&lt;BR /&gt;&lt;BR /&gt;Steve&lt;BR /&gt;</description>
      <pubDate>Sun, 26 May 2002 17:37:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Integer-8-does-not-work/m-p/844800#M62769</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2002-05-26T17:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: Integer*8 does not work ????</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Integer-8-does-not-work/m-p/844801#M62770</link>
      <description>So if integer*2 multiplies are promoted to integer*4, why not be consistent and promote the integer*4 multiply to integer*8?&lt;BR /&gt;&lt;BR /&gt;I'm not sure what the standard has to say about this.</description>
      <pubDate>Mon, 27 May 2002 00:27:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Integer-8-does-not-work/m-p/844801#M62770</guid>
      <dc:creator>WSinc</dc:creator>
      <dc:date>2002-05-27T00:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: Integer*8 does not work ????</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Integer-8-does-not-work/m-p/844802#M62771</link>
      <description>integer*2 multiplies are not promoted to integer*4.  You might be able to come up with a test case that makes it look as if that's happening, but if so, it's accidental.&lt;BR /&gt;&lt;BR /&gt;The standard is quite clear in saying that the kind of the variable on the left side of the assignment is not a factor in evaluating the expression on the right side.  The standard also has clear rules about how expressions are evaluated and when any type conversion is done.&lt;BR /&gt;&lt;BR /&gt;If you had done something like:&lt;BR /&gt;&lt;BR /&gt;i8 = i8 * i4&lt;BR /&gt;&lt;BR /&gt;then a conversion of the i4 to i8 is done before the multiply.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Mon, 27 May 2002 02:54:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Integer-8-does-not-work/m-p/844802#M62771</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2002-05-27T02:54:40Z</dc:date>
    </item>
  </channel>
</rss>

