<?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 I corresponded with a memebr in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043724#M113626</link>
    <description>&lt;P&gt;I corresponded with a memebr of the Fortran comittee, and he confirmed what I have been saying -&lt;/P&gt;

&lt;P&gt;anyway, there is another way to avoid INTEGER OVERFLOW without with having to resort to a higher&lt;/P&gt;

&lt;P&gt;number of bytes in the arithmetic.&lt;/P&gt;

&lt;DIV class="forum-post-wrapper1 D8CommentContainer row-with-author-and-content" style="width: 841px; border: none;"&gt;
	&lt;DIV class="forum-post-panel-main1 clearfix D8Comment content-pane" style="max-width: 760px;"&gt;
		&lt;DIV class="forum-post-content"&gt;
			&lt;DIV class="field field-name-body field-type-text-with-summary field-label-hidden"&gt;
				&lt;DIV class="field-items"&gt;
					&lt;DIV class="field-item even" property="content:encoded"&gt;
						&lt;P style="margin-bottom: 1.5em;"&gt;&amp;nbsp;&lt;/P&gt;

						&lt;P style="margin-bottom: 1.5em;"&gt;&lt;EM&gt;&lt;SPAN style="font-weight: 700;"&gt;integer(8) function two_int(istart,istop,istep)&lt;BR /&gt;
							integer(8) istart,istop,istep,i1m,i2m,i1d,i2d&lt;BR /&gt;
							&amp;nbsp; i1m=mod(istart,istep)&lt;BR /&gt;
							&amp;nbsp; i1d=istart/istep&lt;BR /&gt;
							&amp;nbsp; i2m=mod(istop,istep)&lt;BR /&gt;
							&amp;nbsp; i2d=istop/istep&lt;BR /&gt;
							&amp;nbsp; two_int=i2d-i1d+(i2m-i1m+istep)/istep&lt;BR /&gt;
							end function&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;

						&lt;P style="margin-bottom: 1.5em;"&gt;This method also works for 4 byte quantities.&lt;/P&gt;

						&lt;P style="margin-bottom: 1.5em;"&gt;Or any number of bytes.&lt;/P&gt;

						&lt;P style="margin-bottom: 1.5em;"&gt;Now it might still fail if ISTEP =1 but then the answer &lt;STRONG&gt;cannot be contained in the same number of bytes.&lt;/STRONG&gt;&lt;/P&gt;

						&lt;P style="margin-bottom: 1.5em;"&gt;and the run time would be past the age of the universe, at least for 8 byte results.&lt;/P&gt;
					&lt;/DIV&gt;
				&lt;/DIV&gt;
			&lt;/DIV&gt;
		&lt;/DIV&gt;
	&lt;/DIV&gt;
&lt;/DIV&gt;

&lt;DIV class="forum-post-footer clearfix" style="margin-top: 0px; clear: both; border-bottom-style: none; padding-bottom: 10px;"&gt;
	&lt;DIV class="forum-jump-links" style="float: right; text-align: right; margin: 10px 16px 0px 0px; font-size: 11px;"&gt;&lt;A class="forum-rss-link" href="https://software.intel.com/en-us/forums/topic/543030/feed" style="margin-left: 7px; float: right; display: block; text-align: left; width: 37px; background: url(https://software.intel.com/sites/all/modules/custom/intel_advanced_forum_style/styles/idz/images/icon-forum-rss.jpg) 100% 1px no-repeat transparent;"&gt;RSS&lt;/A&gt;&lt;A class="af-button-small" href="https://software.intel.com/en-us/forums/topic/543030#" style="float: right;" title="Jump to top of page"&gt;Top&lt;/A&gt;

		&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
	&lt;/DIV&gt;

	&lt;DIV class="forum-post-links" style="float: left; text-align: right; margin: 5px 0px 5px 5px; font-size: 11px; padding-left: 90px;"&gt;
		&lt;UL class="links inline"&gt;&lt;/UL&gt;
	&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Wed, 11 Mar 2015 19:27:36 GMT</pubDate>
    <dc:creator>WSinc</dc:creator>
    <dc:date>2015-03-11T19:27:36Z</dc:date>
    <item>
      <title>A foolproof way to calculate DO LOOP iterations.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043712#M113614</link>
      <description>&lt;P style="font-size: 12px;"&gt;An afterthought ;&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;Why not use REAL(16) arithmetic to calculate that?&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;We are always&amp;nbsp;&lt;SPAN style="font-weight: 700;"&gt;guaranteed to get the correct answer&lt;/SPAN&gt;&amp;nbsp;for ANY combination of inputs,&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;and the most extreme range (-huge to +huge)&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;You get &amp;nbsp;a REAL(16) result, which you would round off to get the final number.&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;&lt;EM&gt;&lt;STRONG&gt;NO_STEPS = (real(STOP,16) - real(start,16)+real(step,16))/real(step,16)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;Since the compiler supports REAL(16) arithmetic, this should not cause any problems.&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;Anyway, I wanted to see what the compiler guys think about this, since it completely&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;avoids the&lt;EM&gt;&lt;STRONG&gt; integer overflow curse.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2015 18:44:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043712#M113614</guid>
      <dc:creator>WSinc</dc:creator>
      <dc:date>2015-03-09T18:44:02Z</dc:date>
    </item>
    <item>
      <title>The compiler guys and gals</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043713#M113615</link>
      <description>&lt;P&gt;The compiler guys and gals aren't interested in using calls to a software library to convert integer loop control values to REAL(16), do calculations, then convert back, just in case the computation might overflow. The current behavior is standard-conforming as best as I can tell.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2015 19:24:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043713#M113615</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-03-09T19:24:49Z</dc:date>
    </item>
    <item>
      <title>Many of us would consider</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043714#M113616</link>
      <description>&lt;P&gt;Many of us would consider lack of optimization a real problem. &amp;nbsp;If you like to declare everything with real(real128) that's your option. The Fortran committee once gave us the option of real do parameter but took it away again, but integer (int64) covers a lot.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2015 19:35:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043714#M113616</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2015-03-09T19:35:49Z</dc:date>
    </item>
    <item>
      <title>"it'll probably work MOST of</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043715#M113617</link>
      <description>&lt;P&gt;"it'll probably work MOST of the time?"&lt;/P&gt;

&lt;P&gt;How is that conforming?&lt;/P&gt;

&lt;P&gt;Why can't they do a thorough professional job?&lt;/P&gt;

&lt;P&gt;Is it too much trouble to get it right?&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Where I come from, we tried to do a thorough professional job,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;and sloppiness was not tolerated.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;How would I correspond with the Fortran committee ?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2015 19:36:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043715#M113617</guid>
      <dc:creator>WSinc</dc:creator>
      <dc:date>2015-03-09T19:36:00Z</dc:date>
    </item>
    <item>
      <title>The behavior when</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043716#M113618</link>
      <description>&lt;P&gt;The behavior when computations overflow is covered in the standard by:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;This part of ISO/IEC 1539 does not specify ... the maximum number of images, or the size or complexity of a program and its data that will exceed the&amp;nbsp;capacity of any particular computing system or the capability of a particular processor, ...&amp;nbsp;the physical properties of the representation of quantities and the method of rounding, approximating, or&amp;nbsp;computing numeric values on a particular processor, except by reference to the IEEE International Standard&amp;nbsp;under conditions specified in Clause 14,&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;It's been this way since... forever. You are welcome to write a paper with your concerns and submit it to the committee - instructions are &lt;A href="http://j3-fortran.org/doc/standing/links/013.txt"&gt;here&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;I don't consider the current behavior "sloppy". It would be nice if compilers could warn you when a DO loop count computation goes out of range, and I know that some do. The same goes for integer overflows in expressions and conversions. Fortran has never been a language with training wheels - programmers are expected to be familiar with the numeric models and ranges for each type and kind.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2015 19:59:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043716#M113618</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-03-09T19:59:58Z</dc:date>
    </item>
    <item>
      <title>Oh sure, I am familiar with</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043717#M113619</link>
      <description>&lt;P&gt;Oh sure, I am familiar with the ranges and numeric models - -&lt;/P&gt;

&lt;P&gt;But here we are talking about &lt;STRONG&gt;unpredictable behavior,&lt;/STRONG&gt; since the parameters can be determined by EXPRESSIONS, and DATA inputs.&lt;/P&gt;

&lt;P&gt;so its impossible to determine the outcome with a reasonable degree of certainty.&lt;/P&gt;

&lt;P&gt;If the parameters are given as simple integers, &amp;nbsp;we would be able to tell the outcome then -&lt;/P&gt;

&lt;P&gt;Anyway, rather than submitting a FORMAL PAPER, I'll just send them an E-mail and see what they say about this issue.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2015 20:11:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043717#M113619</guid>
      <dc:creator>WSinc</dc:creator>
      <dc:date>2015-03-09T20:11:07Z</dc:date>
    </item>
    <item>
      <title>Bill,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043718#M113620</link>
      <description>&lt;P&gt;Bill,&lt;/P&gt;

&lt;P&gt;See Quote #12 in your other thread:&amp;nbsp;https://software.intel.com/en-us/forums/topic/542783#comment-1816683&lt;/P&gt;

&lt;P&gt;Why don't you use floating-point arithmetic yourself to guard against integer overflow? &amp;nbsp;This is one area where the standard lays down a basic set of rules and gives the compiler writer flexibility with the integer arithmetic and which, in turn, can benefit all users with optimization, etc. Why try to change that and what'll be the value?&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;Separately, what you're trying to do is difficult to fathom from an algorithmic stand-point - there may be other alternatives&lt;/SPAN&gt;&amp;nbsp;that may help you further.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2015 20:26:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043718#M113620</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2015-03-09T20:26:37Z</dc:date>
    </item>
    <item>
      <title>Bill, if you're intending to</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043719#M113621</link>
      <description>&lt;P&gt;Bill, if you're intending to send mail to Dan Nagle, that won't get you a response from the committee. If you want the committee to consider your questions, write a paper and you'll get a response, probably at the next meeting. Or if you will form your question here, I will pass it on to the committee email list and summarize the response.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2015 21:06:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043719#M113621</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-03-09T21:06:57Z</dc:date>
    </item>
    <item>
      <title>tem que converter valores de</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043720#M113622</link>
      <description>&lt;P&gt;tem que&amp;nbsp;converter valores de controle de laços inteiros para o Real (16), fazer cálculos, em seguida, converter de volta, apenas no caso de a computação pode transbordar.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2015 19:14:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043720#M113622</guid>
      <dc:creator>Cardin_P_</dc:creator>
      <dc:date>2015-03-10T19:14:21Z</dc:date>
    </item>
    <item>
      <title>I know someone on the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043721#M113623</link>
      <description>&lt;P&gt;I know someone on the committee, but not very well.&lt;/P&gt;

&lt;P&gt;Anyway, the fundamental question is: Whether they are required to properly do that calculation under ALL circumstances,&lt;/P&gt;

&lt;P&gt;particularly if the EXCEPTIONS are never described or documented.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;My attitude is: If you are going to CODE something,&lt;STRONG&gt; get it right.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Maybe I am being unreasonable - but I always worked in an environment&lt;/P&gt;

&lt;P&gt;where we were punished for being sloppy. - - -&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Maybe I will submit a paper anyway just for fun. it'll be interesting to get a response, but it'll be really slow - -&amp;nbsp;&lt;/P&gt;

&lt;P&gt;In the meantime, it's pretty easy to work around the problem by using floating point.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2015 20:23:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043721#M113623</guid>
      <dc:creator>WSinc</dc:creator>
      <dc:date>2015-03-10T20:23:00Z</dc:date>
    </item>
    <item>
      <title>&gt;&gt;In the meantime, it's</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043722#M113624</link>
      <description>&lt;P&gt;&amp;gt;&amp;gt;In the meantime, it's pretty easy to work around the problem by using floating point.&lt;/P&gt;

&lt;P&gt;That is misleading. While use of floating point will eliminate the sign flipping, the mantissa has fewer bits than the integer format using the same number of bytes. Therefore, this reduces the range of the numbers of iterations. More importantly, depending on the numbers chosen for start, finish, and step, this may produce an incorrect number of iterations. For these reasons it is better to construct the loop using integers (being mindful of corner conditions), or using an indeterminate do loop where you control the exit condition. But be careful when using a termination condition based on the sum of imprecise rational numbers. (products of iteration number * step is best)&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2015 11:52:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043722#M113624</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2015-03-11T11:52:33Z</dc:date>
    </item>
    <item>
      <title>Huh ? ?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043723#M113625</link>
      <description>&lt;P&gt;Huh ? ?&lt;/P&gt;

&lt;P&gt;Real(16) numbers have over 110 bits in the mantissa.&lt;/P&gt;

&lt;P&gt;SO YOU CAN GET A 33 DECIMAL PLACE INTEGER FROM THOSE.&lt;/P&gt;

&lt;P&gt;The INTEGER(8) variables contain 63 bits plus sign = 64 bits.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2015 15:30:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043723#M113625</guid>
      <dc:creator>WSinc</dc:creator>
      <dc:date>2015-03-11T15:30:00Z</dc:date>
    </item>
    <item>
      <title>I corresponded with a memebr</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043724#M113626</link>
      <description>&lt;P&gt;I corresponded with a memebr of the Fortran comittee, and he confirmed what I have been saying -&lt;/P&gt;

&lt;P&gt;anyway, there is another way to avoid INTEGER OVERFLOW without with having to resort to a higher&lt;/P&gt;

&lt;P&gt;number of bytes in the arithmetic.&lt;/P&gt;

&lt;DIV class="forum-post-wrapper1 D8CommentContainer row-with-author-and-content" style="width: 841px; border: none;"&gt;
	&lt;DIV class="forum-post-panel-main1 clearfix D8Comment content-pane" style="max-width: 760px;"&gt;
		&lt;DIV class="forum-post-content"&gt;
			&lt;DIV class="field field-name-body field-type-text-with-summary field-label-hidden"&gt;
				&lt;DIV class="field-items"&gt;
					&lt;DIV class="field-item even" property="content:encoded"&gt;
						&lt;P style="margin-bottom: 1.5em;"&gt;&amp;nbsp;&lt;/P&gt;

						&lt;P style="margin-bottom: 1.5em;"&gt;&lt;EM&gt;&lt;SPAN style="font-weight: 700;"&gt;integer(8) function two_int(istart,istop,istep)&lt;BR /&gt;
							integer(8) istart,istop,istep,i1m,i2m,i1d,i2d&lt;BR /&gt;
							&amp;nbsp; i1m=mod(istart,istep)&lt;BR /&gt;
							&amp;nbsp; i1d=istart/istep&lt;BR /&gt;
							&amp;nbsp; i2m=mod(istop,istep)&lt;BR /&gt;
							&amp;nbsp; i2d=istop/istep&lt;BR /&gt;
							&amp;nbsp; two_int=i2d-i1d+(i2m-i1m+istep)/istep&lt;BR /&gt;
							end function&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;

						&lt;P style="margin-bottom: 1.5em;"&gt;This method also works for 4 byte quantities.&lt;/P&gt;

						&lt;P style="margin-bottom: 1.5em;"&gt;Or any number of bytes.&lt;/P&gt;

						&lt;P style="margin-bottom: 1.5em;"&gt;Now it might still fail if ISTEP =1 but then the answer &lt;STRONG&gt;cannot be contained in the same number of bytes.&lt;/STRONG&gt;&lt;/P&gt;

						&lt;P style="margin-bottom: 1.5em;"&gt;and the run time would be past the age of the universe, at least for 8 byte results.&lt;/P&gt;
					&lt;/DIV&gt;
				&lt;/DIV&gt;
			&lt;/DIV&gt;
		&lt;/DIV&gt;
	&lt;/DIV&gt;
&lt;/DIV&gt;

&lt;DIV class="forum-post-footer clearfix" style="margin-top: 0px; clear: both; border-bottom-style: none; padding-bottom: 10px;"&gt;
	&lt;DIV class="forum-jump-links" style="float: right; text-align: right; margin: 10px 16px 0px 0px; font-size: 11px;"&gt;&lt;A class="forum-rss-link" href="https://software.intel.com/en-us/forums/topic/543030/feed" style="margin-left: 7px; float: right; display: block; text-align: left; width: 37px; background: url(https://software.intel.com/sites/all/modules/custom/intel_advanced_forum_style/styles/idz/images/icon-forum-rss.jpg) 100% 1px no-repeat transparent;"&gt;RSS&lt;/A&gt;&lt;A class="af-button-small" href="https://software.intel.com/en-us/forums/topic/543030#" style="float: right;" title="Jump to top of page"&gt;Top&lt;/A&gt;

		&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
	&lt;/DIV&gt;

	&lt;DIV class="forum-post-links" style="float: left; text-align: right; margin: 5px 0px 5px 5px; font-size: 11px; padding-left: 90px;"&gt;
		&lt;UL class="links inline"&gt;&lt;/UL&gt;
	&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 11 Mar 2015 19:27:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043724#M113626</guid>
      <dc:creator>WSinc</dc:creator>
      <dc:date>2015-03-11T19:27:36Z</dc:date>
    </item>
    <item>
      <title>Yes, Van contacted me about</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043725#M113627</link>
      <description>&lt;P&gt;Yes, Van contacted me about this. Can you name any other compilers that do it the way you want? Are there any real-world applications that would benefit from this more complex computation?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2015 19:44:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043725#M113627</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-03-11T19:44:29Z</dc:date>
    </item>
    <item>
      <title>When I was working at JPL and</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043726#M113628</link>
      <description>&lt;P&gt;When I was working at JPL and the Aerospace Corp, both were science/engineering applications,&lt;/P&gt;

&lt;P&gt;and the CPU always had integer overflow traps. so if you got a wrong result, you always &lt;STRONG&gt;knew it.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I don't recall any situations where I got a bad result from doing integer computations there.&lt;/P&gt;

&lt;P&gt;Now those were IBM and UNIVAC mainframes - - not PC consoles.&lt;/P&gt;

&lt;P&gt;As far as applications, the one that I am involved NOW&lt;/P&gt;

&lt;P&gt;with is cryptography, which uses large integers,&lt;/P&gt;

&lt;P&gt;and some appear in DO LOOPS as well. Which is why the situations I am talking about can occur in practice.&lt;/P&gt;

&lt;P&gt;I cannot speak for others, since I dont know their particular applications.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2015 20:00:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043726#M113628</guid>
      <dc:creator>WSinc</dc:creator>
      <dc:date>2015-03-11T20:00:03Z</dc:date>
    </item>
    <item>
      <title>Just using large integers is</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043727#M113629</link>
      <description>&lt;P&gt;Just using large integers is not the issue. What kind of applications would have DO loops with loop counts whose computation might cause an overflow?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2015 20:38:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043727#M113629</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-03-11T20:38:14Z</dc:date>
    </item>
    <item>
      <title>Besides cryptography, another</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043728#M113630</link>
      <description>&lt;P&gt;Besides cryptography, another such application is in NUMBER THEORY,&lt;/P&gt;

&lt;P&gt;where you want to determine if a set of numbers is prime, -&lt;/P&gt;

&lt;P&gt;i.e. which are prime, which are composite.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2015 22:36:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043728#M113630</guid>
      <dc:creator>WSinc</dc:creator>
      <dc:date>2015-03-11T22:36:11Z</dc:date>
    </item>
    <item>
      <title>billsincl wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043729#M113631</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;billsincl wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Besides cryptography, another such application is in NUMBER THEORY,&lt;/P&gt;

&lt;P&gt;where you want to determine if a set of numbers is prime, -&lt;/P&gt;

&lt;P&gt;i.e. which are prime, which are composite.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Yeah, why are loop counters required? &amp;nbsp;As Steve and Jim have suggested, why can't ordinary DO.. END DO be used instead that gives control and flexibility (and places responsibility) to the coder?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2015 15:50:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043729#M113631</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2015-03-12T15:50:10Z</dc:date>
    </item>
    <item>
      <title>The only prime number</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043730#M113632</link>
      <description>&lt;P&gt;The only prime number factorization programs that might be affected by this are those written by introductory programming students. Anyone really trying to factor primes would be using different approaches that don't just have a counted DO loop to infinity...&lt;/P&gt;

&lt;P&gt;All of the proposed "fixes" for this would very likely hurt optimization, especially vectorization of nested loops.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2015 15:58:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043730#M113632</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-03-12T15:58:09Z</dc:date>
    </item>
    <item>
      <title>There is such a thing as</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043731#M113633</link>
      <description>&lt;P&gt;There is such a thing as being overly cautious, and being overly cautious can lead to poor performance or even disaster. In the famous Battle of Agincourt, "Approximately 8,000 of the heavily armoured French men-at-arms fought on foot, and needed to close the distance to the English army to engage them in hand-to-hand fighting. If they could close the distance, however, they outnumbered the English men-at-arms by more than 5-to-1..." (quoting Wikipedia here). Unfortunately for them, they had to wade through thick mud to close the distance, and the English longbow archers slaughtered them before they could close.&lt;/P&gt;

&lt;P&gt;Similarly, it could be disastrous to use the suggested DO loops with slow INTEGER*8 and REAL*16 arithmetic making many memory accesses versus a small but fast set of calculations in the small register files of the IA/32 and X64 architectures.&lt;/P&gt;

&lt;P&gt;"Doing it right" sounds virtuous, but if you spend so much time doing it right that you don't get it done, you will not win praises for being virtuous.&lt;/P&gt;

&lt;P&gt;A problem with "foolproof" solutions is that you have to test them on a representative sample of "fools" for proof-of-concept, and volunteers can be hard to secure.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2015 16:21:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/A-foolproof-way-to-calculate-DO-LOOP-iterations/m-p/1043731#M113633</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-03-12T16:21:00Z</dc:date>
    </item>
  </channel>
</rss>

