<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "C# Sum() i OverflowException"]]></title>
		<link>http://mendo.mk/jforum/posts/list/16.page</link>
		<description><![CDATA[Latest messages posted in the topic "C# Sum() i OverflowException"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>C# Sum() i OverflowException</title>
				<description><![CDATA[ Me interesira na koj nacin moze da se presmeta zbirot na site elementi od edna niza.<br /> Pri presmetuvanjeto na niza {-1840512878, -2147418112} so metodot Sum(), compiler-ot javuva OverflowException.<br /> Isto taka bi bil blagodaren dokolku bi mozele da pojasnite sto pretstavuva OverflowException.]]></description>
				<guid isPermaLink="true">http://mendo.mk/jforum/posts/preList/396/2853.page</guid>
				<link>http://mendo.mk/jforum/posts/preList/396/2853.page</link>
				<pubDate><![CDATA[Thu, 25 Jun 2015 22:50:28]]> GMT</pubDate>
				<author><![CDATA[ freetree66]]></author>
			</item>
			<item>
				<title>Re:C# Sum() i OverflowException</title>
				<description><![CDATA[ OverflowException добиваш кога на променлива од даден тип ќе добие вредност надвор од опсегот, како што е со твојот случај. Кога ќе се пресмета сумата, се добива вредност надвор од опсегот на int (-2,147,483,648 до 2,147,483,647). Смени го int со long и ќе немаш проблем.]]></description>
				<guid isPermaLink="true">http://mendo.mk/jforum/posts/preList/396/2854.page</guid>
				<link>http://mendo.mk/jforum/posts/preList/396/2854.page</link>
				<pubDate><![CDATA[Fri, 26 Jun 2015 13:35:33]]> GMT</pubDate>
				<author><![CDATA[ despotovski01]]></author>
			</item>
			<item>
				<title>Re:C# Sum() i OverflowException</title>
				<description><![CDATA[ [quote]Смени го int со long и ќе немаш проблем.[/quote]<br /> Vo baraniov slucaj [b]mora[/b] da se vrati vrednost od tipot [b]int[/b].]]></description>
				<guid isPermaLink="true">http://mendo.mk/jforum/posts/preList/396/2855.page</guid>
				<link>http://mendo.mk/jforum/posts/preList/396/2855.page</link>
				<pubDate><![CDATA[Mon, 29 Jun 2015 21:56:18]]> GMT</pubDate>
				<author><![CDATA[ freetree66]]></author>
			</item>
			<item>
				<title>Re:C# Sum() i OverflowException</title>
				<description><![CDATA[ Go postiram kodot dokolku mu pomogne na nekogo da prilozi odgovor<br /> <br /> [code]<br /> using System;<br /> using System.Linq;<br /> public class Program {<br />     public static int Puzzle( int[] v) {<br />         return v.Sum();<br />     }<br /> }<br /> [/code]<br /> <br /> Ova se test slucaevite :<br /> <br /> [b]1[/b]. Za v {0}; Expected result: 0 ; Your result: 0<br /> [b]2.[/b] Za v {1}; Expected result: 0 ; Your result: 0<br /> [b]3.[/b] Za v {-1840512878, -2147418112}; Expected result: 307036306 ; Your result: "NULL" ; Description: Mismatch -&gt; OverflowException;]]></description>
				<guid isPermaLink="true">http://mendo.mk/jforum/posts/preList/396/2856.page</guid>
				<link>http://mendo.mk/jforum/posts/preList/396/2856.page</link>
				<pubDate><![CDATA[Thu, 2 Jul 2015 16:05:44]]> GMT</pubDate>
				<author><![CDATA[ freetree66]]></author>
			</item>
			<item>
				<title>Re:C# Sum() i OverflowException</title>
				<description><![CDATA[ [quote=freetree66]Go postiram kodot dokolku mu pomogne na nekogo da prilozi odgovor<br /> <br /> [code]<br /> using System;<br /> using System.Linq;<br /> public class Program {<br />     public static int Puzzle( int[] v) {<br />         return v.Sum();<br />     }<br /> }<br /> [/code]<br /> <br /> Ova se test slucaevite :<br /> <br /> [b]1[/b]. Za v {0}; Expected result: 0 ; Your result: 0<br /> [b]2.[/b] Za v {1}; Expected result: 0 ; Your result: 0<br /> [b]3.[/b] Za v {-1840512878, -2147418112}; Expected result: 307036306 ; Your result: "NULL" ; Description: Mismatch -&gt; OverflowException;[/quote]<br /> <br /> Како што ти одговорија погоре, не можеш да користиш int тука. Конкретно за твојот случај, (-1840512878 ) + (-2147418112) = -3987930990, што е повеќе од тоа што може да собере во int променлива. Така да не [b]мора[/b] да се врати вредност од типот [b]int[/b].  :) ]]></description>
				<guid isPermaLink="true">http://mendo.mk/jforum/posts/preList/396/2860.page</guid>
				<link>http://mendo.mk/jforum/posts/preList/396/2860.page</link>
				<pubDate><![CDATA[Mon, 13 Jul 2015 19:05:51]]> GMT</pubDate>
				<author><![CDATA[ addictus]]></author>
			</item>
	</channel>
</rss>