<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, int is not equal to add - why ?</title>
    <link>http://www.mapleprimes.com/questions/87753-Int-Is-Not-Equal-To-Add--Why-</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Tue, 16 Jun 2026 13:18:39 GMT</lastBuildDate>
    <pubDate>Tue, 16 Jun 2026 13:18:39 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, int is not equal to add - why ?</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, int is not equal to add - why ?</title>
      <link>http://www.mapleprimes.com/questions/87753-Int-Is-Not-Equal-To-Add--Why-</link>
    </image>
    <item>
      <title>why should it?</title>
      <link>http://www.mapleprimes.com/questions/87753-Int-Is-Not-Equal-To-Add--Why-?ref=Feed:MaplePrimes:int is not equal to add - why ?:Comments#answer88051</link>
      <itunes:summary>&lt;p&gt;Both are different techniques.&amp;nbsp; As an example, take the first part of the equation you are using&lt;/p&gt;
&lt;p&gt;p^n*2^(n-1)&lt;/p&gt;
&lt;p&gt;This simplifies down to 0.5 with your numbers.&amp;nbsp; So when you add 0.5 from n=1 to 7, then maple will be adding 0.5 seven times (n=1,2,3,...,7).&amp;nbsp; As for the integration, this is usually viewed as area under the curve, so in this case you are finding the area of a rectangle with the width 0.5 and length 6.&amp;nbsp; Therefore the sumation will produce 3.5 and integration 3.0.&amp;nbsp; This is likely why you are getting different results&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Both are different techniques.&amp;nbsp; As an example, take the first part of the equation you are using&lt;/p&gt;
&lt;p&gt;p^n*2^(n-1)&lt;/p&gt;
&lt;p&gt;This simplifies down to 0.5 with your numbers.&amp;nbsp; So when you add 0.5 from n=1 to 7, then maple will be adding 0.5 seven times (n=1,2,3,...,7).&amp;nbsp; As for the integration, this is usually viewed as area under the curve, so in this case you are finding the area of a rectangle with the width 0.5 and length 6.&amp;nbsp; Therefore the sumation will produce 3.5 and integration 3.0.&amp;nbsp; This is likely why you are getting different results&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;</description>
      <guid>88051</guid>
      <pubDate>Tue, 11 May 2010 17:20:00 Z</pubDate>
      <itunes:author>Scott03</itunes:author>
      <author>Scott03</author>
    </item>
    <item>
      <title>ok, thanx. Yes, you might be</title>
      <link>http://www.mapleprimes.com/questions/87753-Int-Is-Not-Equal-To-Add--Why-?ref=Feed:MaplePrimes:int is not equal to add - why ?:Comments#answer88052</link>
      <itunes:summary>&lt;p&gt;ok, thanx. Yes, you might be right.&amp;nbsp; I forgot that you lose 1 on the  length&amp;nbsp; ie&amp;nbsp; 0.5*( 7-1) =0.5*6 =3.&lt;br /&gt;
It would have been easier though if  the length would have been the same ie &lt;br /&gt;
a starting point of zero ie 0.5*( 7-0) =0.5*7 =3.5 but then I guess add would produce 4 humm..&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;ok, thanx. Yes, you might be right.&amp;nbsp; I forgot that you lose 1 on the  length&amp;nbsp; ie&amp;nbsp; 0.5*( 7-1) =0.5*6 =3.&lt;br /&gt;
It would have been easier though if  the length would have been the same ie &lt;br /&gt;
a starting point of zero ie 0.5*( 7-0) =0.5*7 =3.5 but then I guess add would produce 4 humm..&lt;/p&gt;</description>
      <guid>88052</guid>
      <pubDate>Tue, 11 May 2010 17:45:37 Z</pubDate>
      <itunes:author>alex_01</itunes:author>
      <author>alex_01</author>
    </item>
    <item>
      <title>but that is another</title>
      <link>http://www.mapleprimes.com/questions/87753-Int-Is-Not-Equal-To-Add--Why-?ref=Feed:MaplePrimes:int is not equal to add - why ?:Comments#answer88053</link>
      <itunes:summary>&lt;p&gt;but that is another thing:&lt;br /&gt;
&lt;br /&gt;
add(.5, x = 0 .. 7);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4.0&lt;br /&gt;
0.5*7;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3.5&lt;br /&gt;
??&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;but that is another thing:&lt;br /&gt;
&lt;br /&gt;
add(.5, x = 0 .. 7);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4.0&lt;br /&gt;
0.5*7;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3.5&lt;br /&gt;
??&lt;/p&gt;</description>
      <guid>88053</guid>
      <pubDate>Tue, 11 May 2010 17:52:57 Z</pubDate>
      <itunes:author>alex_01</itunes:author>
      <author>alex_01</author>
    </item>
    <item>
      <title>n+1</title>
      <link>http://www.mapleprimes.com/questions/87753-Int-Is-Not-Equal-To-Add--Why-?ref=Feed:MaplePrimes:int is not equal to add - why ?:Comments#answer88054</link>
      <itunes:summary>&lt;p&gt;You have to watch out for the number of times add will add the numbers.&amp;nbsp; It will take the very first location (here x=0) then at every integer value between and including the end point of your interval.&amp;nbsp; So both ends of the interval will be included in the sumation if they are integers.&lt;/p&gt;
&lt;p&gt;*edit: I had at first thought that if you wanted to remove the beginning of the sumation that you only needed to change the range to x=0.01..7, but I was incorrect.&amp;nbsp; To see what is going on try the following&lt;/p&gt;
&lt;p&gt;add(f(x),x=0..7);&lt;/p&gt;
&lt;p&gt;add(f(x),x=0.1..7);&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;You have to watch out for the number of times add will add the numbers.&amp;nbsp; It will take the very first location (here x=0) then at every integer value between and including the end point of your interval.&amp;nbsp; So both ends of the interval will be included in the sumation if they are integers.&lt;/p&gt;
&lt;p&gt;*edit: I had at first thought that if you wanted to remove the beginning of the sumation that you only needed to change the range to x=0.01..7, but I was incorrect.&amp;nbsp; To see what is going on try the following&lt;/p&gt;
&lt;p&gt;add(f(x),x=0..7);&lt;/p&gt;
&lt;p&gt;add(f(x),x=0.1..7);&lt;/p&gt;
&lt;p&gt;Scott&lt;/p&gt;</description>
      <guid>88054</guid>
      <pubDate>Tue, 11 May 2010 17:58:00 Z</pubDate>
      <itunes:author>Scott03</itunes:author>
      <author>Scott03</author>
    </item>
    <item>
      <title>With second thought it kind</title>
      <link>http://www.mapleprimes.com/questions/87753-Int-Is-Not-Equal-To-Add--Why-?ref=Feed:MaplePrimes:int is not equal to add - why ?:Comments#answer88055</link>
      <itunes:summary>&lt;p&gt;With second thought it kind of make sense to have&amp;nbsp; add(0.5, x = 0 .. 7) =  4.0&amp;nbsp; &lt;br /&gt;
Since a 0.5 line has a value of 0.5 at 0&amp;nbsp; ie&amp;nbsp;  add(0.5, x = 0 .. 7) = add(0.5, x = 1 ..  8) = 4.0&lt;br /&gt;
I am not completely comfortable with that&amp;nbsp;&amp;nbsp;&amp;nbsp; int&amp;lt;&amp;gt;  add&amp;nbsp;&amp;nbsp; but I might get over it :-)&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;a href="http://www.mapleprimes.com/viewfile/4333"&gt;&lt;img src="http://www.mapleprimes.com/scripts/image.php?image=http://www.mapleprimes.com/files/8342_QQ.jpg&amp;amp;width=300&amp;amp;height=300" alt="" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;With second thought it kind of make sense to have&amp;nbsp; add(0.5, x = 0 .. 7) =  4.0&amp;nbsp; &lt;br /&gt;
Since a 0.5 line has a value of 0.5 at 0&amp;nbsp; ie&amp;nbsp;  add(0.5, x = 0 .. 7) = add(0.5, x = 1 ..  8) = 4.0&lt;br /&gt;
I am not completely comfortable with that&amp;nbsp;&amp;nbsp;&amp;nbsp; int&amp;lt;&amp;gt;  add&amp;nbsp;&amp;nbsp; but I might get over it :-)&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;a href="http://www.mapleprimes.com/viewfile/4333"&gt;&lt;img src="http://www.mapleprimes.com/scripts/image.php?image=http://www.mapleprimes.com/files/8342_QQ.jpg&amp;amp;width=300&amp;amp;height=300" alt="" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;</description>
      <guid>88055</guid>
      <pubDate>Tue, 11 May 2010 18:18:22 Z</pubDate>
      <itunes:author>alex_01</itunes:author>
      <author>alex_01</author>
    </item>
    <item>
      <title>counts, inclusive</title>
      <link>http://www.mapleprimes.com/questions/87753-Int-Is-Not-Equal-To-Add--Why-?ref=Feed:MaplePrimes:int is not equal to add - why ?:Comments#comment88056</link>
      <itunes:summary>&lt;p&gt;The number of integers between integers A and B, &lt;i&gt;inclusive&lt;/i&gt;, is B-A+1.&lt;/p&gt;
&lt;p&gt;So between 0 and 7, inclusive, there are eight integers.&lt;/p&gt;
&lt;p&gt;You can check this by counting from 0 to 7 on your fingers. If that is confusing, then try it first from 1 to 8. And then think about why that is the same as counting from 0 to 7.&lt;/p&gt;
&lt;p&gt;Hence&lt;/p&gt;
&lt;pre&gt;
&amp;gt; add(0.5,x=0..7);
                                      4.0
 
&amp;gt; add(0.5,x=1..8);
                                      4.0
 
&amp;gt; 0.5*8;
                                      4.0
&lt;/pre&gt;</itunes:summary>
      <description>&lt;p&gt;The number of integers between integers A and B, &lt;i&gt;inclusive&lt;/i&gt;, is B-A+1.&lt;/p&gt;
&lt;p&gt;So between 0 and 7, inclusive, there are eight integers.&lt;/p&gt;
&lt;p&gt;You can check this by counting from 0 to 7 on your fingers. If that is confusing, then try it first from 1 to 8. And then think about why that is the same as counting from 0 to 7.&lt;/p&gt;
&lt;p&gt;Hence&lt;/p&gt;
&lt;pre&gt;
&amp;gt; add(0.5,x=0..7);
                                      4.0
 
&amp;gt; add(0.5,x=1..8);
                                      4.0
 
&amp;gt; 0.5*8;
                                      4.0
&lt;/pre&gt;</description>
      <guid>88056</guid>
      <pubDate>Wed, 12 May 2010 01:16:47 Z</pubDate>
      <itunes:author>pagan</itunes:author>
      <author>pagan</author>
    </item>
  </channel>
</rss>