<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1037515" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1037515</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/limith-and-floath#comment-1215099</link>
    <description> &lt;p&gt;Not a problem! Sorry I didn&#039;t explain it better in my first reply. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/big.png&quot; title=&quot;Laughing out loud&quot; alt=&quot;Laughing out loud&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Wed, 14 Feb 2007 14:29:33 +0000</pubDate>
 <dc:creator>timjpriebe</dc:creator>
 <guid isPermaLink="false">comment 1215099 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/limith-and-floath#comment-1215098</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote: While it&#039;s tedious, I sometimes find that if I get a white board (or paper) and calculator out and track each of the variables involved manually through the loop, I can figure out what&#039;s going on.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Great advice Tim, now it makes perfect sense what&#039;s going on in there. Thanks!&lt;/p&gt;
 </description>
     <pubDate>Wed, 14 Feb 2007 14:24:10 +0000</pubDate>
 <dc:creator>teammatt3</dc:creator>
 <guid isPermaLink="false">comment 1215098 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/limith-and-floath#comment-1215091</link>
    <description> &lt;p&gt;The for loop is just evaluating the same thing at the same time. Remember, you&#039;re checking the last variable that was put into factorial. The computer has no way of knowing what&#039;s ABOUT TO be put in there.&lt;/p&gt;
&lt;p&gt;If you want it in the condition, your condition (assuming it&#039;s a while loop) should read like this:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;while ( (number * factorial &amp;lt;= factor) &amp;amp;&amp;amp; (factor &amp;gt; 0) )&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;Does that make sense?&lt;/p&gt;
&lt;p&gt;While it&#039;s tedious, I sometimes find that if I get a white board (or paper) and calculator out and track each of the variables involved manually through the loop, I can figure out what&#039;s going on.&lt;/p&gt;
 </description>
     <pubDate>Wed, 14 Feb 2007 13:07:43 +0000</pubDate>
 <dc:creator>timjpriebe</dc:creator>
 <guid isPermaLink="false">comment 1215091 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/limith-and-floath#comment-1215060</link>
    <description> &lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Now it should work if I throw it in a for loop like the following, right?&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;unsigned long long int factorial = 1, number = 1, factor = ULONG_MAX;&lt;br /&gt;&lt;br /&gt;for(; factorial &amp;lt;= factor; number++)&lt;br /&gt;{&lt;br /&gt;factorial = number * factorial;&lt;br /&gt;&lt;br /&gt;printf(&amp;quot;llu&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; llu\n&amp;quot;, number factorial);&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;A for loop evaluates the expression &lt;em&gt;before &lt;/em&gt;it gives the printf() output, right?. Apparently it doesn&#039;t, that gives me the same result (number goes up to 13) (that is without the if in it).&lt;/p&gt;
&lt;p&gt;Arggg, I just don&#039;t get what is going on...&lt;/p&gt;
&lt;p&gt;Tim, the if solves my problem &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;. It is good enough with my experiments but if it were graded I would get knocked for inefficiency. I asked my professor about it, and his answer totally confused me, which is why I turned to you guys &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;.&lt;/p&gt;
 </description>
     <pubDate>Tue, 13 Feb 2007 20:12:20 +0000</pubDate>
 <dc:creator>teammatt3</dc:creator>
 <guid isPermaLink="false">comment 1215060 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/limith-and-floath#comment-1215033</link>
    <description> &lt;p&gt;Simple, the loop checks factorial at the beginning, before factorial gets recalculated. So the last time it does the check, factorial is, indeed, less than (or equal to) ULONG_MAX. Then factorial is recalculated, at which point it is then printed, being greater than ULONG_MAX.&lt;/p&gt;
&lt;p&gt;If you&#039;re just looking to change the output, change&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;printf(&amp;quot;%llu&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %llu\n&amp;quot;, number, factorial);&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;to&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;if (factorial &amp;lt;= factor)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; printf(&amp;quot;%llu&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %llu\n&amp;quot;, number, factorial);&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Tue, 13 Feb 2007 13:17:15 +0000</pubDate>
 <dc:creator>timjpriebe</dc:creator>
 <guid isPermaLink="false">comment 1215033 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
