<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Percentage calculation with negative numbers</title>
	<atom:link href="http://polymathprogrammer.com/2008/11/28/percentage-calculation-with-negative-numbers/feed/" rel="self" type="application/rss+xml" />
	<link>http://polymathprogrammer.com/2008/11/28/percentage-calculation-with-negative-numbers/</link>
	<description>Math and programming with bytes of random curiosity</description>
	<lastBuildDate>Sun, 21 Mar 2010 10:13:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Vincent Tan</title>
		<link>http://polymathprogrammer.com/2008/11/28/percentage-calculation-with-negative-numbers/comment-page-1/#comment-5864</link>
		<dc:creator>Vincent Tan</dc:creator>
		<pubDate>Fri, 07 Aug 2009 13:22:07 +0000</pubDate>
		<guid isPermaLink="false">http://polymathprogrammer.com/?p=875#comment-5864</guid>
		<description>Hi Steve, those are good answers.

What would happen if the numbers were 0, 0, 0, 0, 4, 6? The first 4 should contribute 0%, the 5th number 40% and the last number 60%? It doesn&#039;t make sense to me to give percentage contributions to the first 4 zeroes...

So the first answer you suggested has a specific condition. Which makes sense. And equally easy to explain to a non-tech, non-math layperson as the &quot;all are 0%&quot; explanation.

Your second answer is also correct. It&#039;s a little hard to explain NaN to a layperson though... the context is a financial report. The user doesn&#039;t care how edge cases are handled, only that they&#039;re handled, and easily understood.

Thanks for your comment!</description>
		<content:encoded><![CDATA[<p>Hi Steve, those are good answers.</p>
<p>What would happen if the numbers were 0, 0, 0, 0, 4, 6? The first 4 should contribute 0%, the 5th number 40% and the last number 60%? It doesn&#8217;t make sense to me to give percentage contributions to the first 4 zeroes&#8230;</p>
<p>So the first answer you suggested has a specific condition. Which makes sense. And equally easy to explain to a non-tech, non-math layperson as the &#8220;all are 0%&#8221; explanation.</p>
<p>Your second answer is also correct. It&#8217;s a little hard to explain NaN to a layperson though&#8230; the context is a financial report. The user doesn&#8217;t care how edge cases are handled, only that they&#8217;re handled, and easily understood.</p>
<p>Thanks for your comment!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://polymathprogrammer.com/2008/11/28/percentage-calculation-with-negative-numbers/comment-page-1/#comment-5863</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Fri, 07 Aug 2009 00:15:13 +0000</pubDate>
		<guid isPermaLink="false">http://polymathprogrammer.com/?p=875#comment-5863</guid>
		<description>There are at least two other possible answers to the question &quot;How much does each zero contribute to the sum of 0&quot;.  Since zero is equal to zero, each of the 0&#039;s you added together contributed to the sum equally.  Therefore, you could say that each 0 contributes 100 percent divided by the number of zeros (so if you add together two 0&#039;s each contributed 50% to the sum, three 0&#039;s would each contribute 33 1/3%, four would each contribute 25%, etc.

In computer floating-point arithmetic, since zero divided by zero is ambiguous (zero divided by a non-zero number is 0, so 0/0 should be 0; but anything divided by zero is either plus or minus infinity) the operation 0/0 results in a number called NaN, or Not a Number.  [Yes, Not a Number is a number.  It&#039;s counterintuitive, but it&#039;s true.]  Because of that, a fourth possible answer is that each zero contributes NaN percent to the sum.</description>
		<content:encoded><![CDATA[<p>There are at least two other possible answers to the question &#8220;How much does each zero contribute to the sum of 0&#8243;.  Since zero is equal to zero, each of the 0&#8217;s you added together contributed to the sum equally.  Therefore, you could say that each 0 contributes 100 percent divided by the number of zeros (so if you add together two 0&#8217;s each contributed 50% to the sum, three 0&#8217;s would each contribute 33 1/3%, four would each contribute 25%, etc.</p>
<p>In computer floating-point arithmetic, since zero divided by zero is ambiguous (zero divided by a non-zero number is 0, so 0/0 should be 0; but anything divided by zero is either plus or minus infinity) the operation 0/0 results in a number called NaN, or Not a Number.  [Yes, Not a Number is a number.  It's counterintuitive, but it's true.]  Because of that, a fourth possible answer is that each zero contributes NaN percent to the sum.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Is math important to programming? &#124; Polymath Programmer</title>
		<link>http://polymathprogrammer.com/2008/11/28/percentage-calculation-with-negative-numbers/comment-page-1/#comment-5511</link>
		<dc:creator>Is math important to programming? &#124; Polymath Programmer</dc:creator>
		<pubDate>Mon, 06 Apr 2009 09:01:46 +0000</pubDate>
		<guid isPermaLink="false">http://polymathprogrammer.com/?p=875#comment-5511</guid>
		<description>[...] math, despite their math origins. How hard can it be to sum up figures, do discrete prorating, calculate percentages or find out the price based on existing [...]</description>
		<content:encoded><![CDATA[<p>[...] math, despite their math origins. How hard can it be to sum up figures, do discrete prorating, calculate percentages or find out the price based on existing [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vincent Tan</title>
		<link>http://polymathprogrammer.com/2008/11/28/percentage-calculation-with-negative-numbers/comment-page-1/#comment-5307</link>
		<dc:creator>Vincent Tan</dc:creator>
		<pubDate>Sun, 14 Dec 2008 12:33:42 +0000</pubDate>
		<guid isPermaLink="false">http://polymathprogrammer.com/?p=875#comment-5307</guid>
		<description>The case in point dealt with monetary values. The values are supposed to be non-negative. Actually, they&#039;re supposed to be all positive.

Some business logic changes later, and financial adjustments (such as credit and waivers) came into the picture. So the possibility of having zero or even negative values became real. (And has now happened)

It&#039;s a financial report, and the users want a percentage for each value, which represents how much it contributes to the sum total. Based on this, do you have a suitable solution, Will?

Frankly, I don&#039;t see a right or wrong answer... business-wise. Mathematically though...</description>
		<content:encoded><![CDATA[<p>The case in point dealt with monetary values. The values are supposed to be non-negative. Actually, they&#8217;re supposed to be all positive.</p>
<p>Some business logic changes later, and financial adjustments (such as credit and waivers) came into the picture. So the possibility of having zero or even negative values became real. (And has now happened)</p>
<p>It&#8217;s a financial report, and the users want a percentage for each value, which represents how much it contributes to the sum total. Based on this, do you have a suitable solution, Will?</p>
<p>Frankly, I don&#8217;t see a right or wrong answer&#8230; business-wise. Mathematically though&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Will Dwinnell</title>
		<link>http://polymathprogrammer.com/2008/11/28/percentage-calculation-with-negative-numbers/comment-page-1/#comment-5305</link>
		<dc:creator>Will Dwinnell</dc:creator>
		<pubDate>Sun, 14 Dec 2008 08:54:40 +0000</pubDate>
		<guid isPermaLink="false">http://polymathprogrammer.com/?p=875#comment-5305</guid>
		<description>I will respectfully disagree about taking absolute values just to make percentage calculations &quot;work&quot;.  I suggest instead, that one considers the meaning which is usually impart to the idea of a percentage: A percentage normally represents a fraction of a whole.  In this context, neither the fraction nor the whole could ever be negative.  My conclusion is that if you are trying to take percentages where one or more numbers might be negative, then you may want to seriously reconsider what you are doing.

&lt;abbr&gt;&lt;em&gt;&lt;abbr&gt;&lt;em&gt;Will Dwinnells last blog post..&lt;a href=&quot;http://matlabdatamining.blogspot.com/2008/11/parallel-programming-first-look.html&quot; rel=&quot;nofollow&quot;&gt;Parallel Programming: A First Look&lt;/a&gt;&lt;/em&gt;&lt;/abbr&gt;&lt;/abbr&gt;&lt;/em&gt;</description>
		<content:encoded><![CDATA[<p>I will respectfully disagree about taking absolute values just to make percentage calculations &#8220;work&#8221;.  I suggest instead, that one considers the meaning which is usually impart to the idea of a percentage: A percentage normally represents a fraction of a whole.  In this context, neither the fraction nor the whole could ever be negative.  My conclusion is that if you are trying to take percentages where one or more numbers might be negative, then you may want to seriously reconsider what you are doing.</p>
<p><abbr><em><abbr><em>Will Dwinnells last blog post..<a href="http://matlabdatamining.blogspot.com/2008/11/parallel-programming-first-look.html" rel="nofollow">Parallel Programming: A First Look</a></em></abbr></em></abbr></p>
]]></content:encoded>
	</item>
</channel>
</rss>
