<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>Problem with the Scala Tutorial and perhaps Kojo itself.</title>
		<link>http://kogics.wikidot.com/forum/t-1305918/problem-with-the-scala-tutorial-and-perhaps-kojo-itself</link>
		<description>Posts in the discussion thread &quot;Problem with the Scala Tutorial and perhaps Kojo itself.&quot; - Following &quot;Expressions&quot; under Scala tutorial. Ran the expression: 3.5*9.4+7/5 returns an incorrect result of 33.9.</description>
				<copyright></copyright>
		<lastBuildDate>Wed, 15 Apr 2026 12:46:53 +0000</lastBuildDate>
		
					<item>
				<guid>http://kogics.wikidot.com/forum/t-1305918#post-2350292</guid>
				<title>(no title)</title>
				<link>http://kogics.wikidot.com/forum/t-1305918/problem-with-the-scala-tutorial-and-perhaps-kojo-itself#post-2350292</link>
				<description></description>
				<pubDate>Sun, 02 Aug 2015 05:13:41 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>FYI, Scala uses <em>integer division</em> from the Java world.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-1305918#post-2350140</guid>
				<title>(no title)</title>
				<link>http://kogics.wikidot.com/forum/t-1305918/problem-with-the-scala-tutorial-and-perhaps-kojo-itself#post-2350140</link>
				<description></description>
				<pubDate>Sat, 01 Aug 2015 21:13:10 +0000</pubDate>
				<wikidot:authorName>Darin Lee Murphy</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>This is an update on the above issue. I think I figured out what's wrong with Kojo/Scala. In the expression 3.5*9.4+7/5 the 7/5 isn't being converted into a floating point or real number before it is added to product of 3.5*9.4. This can be illustrated in the following script:</p> <p>println(3.5*9.4+7/5) // Returns 33.9<br /> println(3.5*9.4+7.0/5) // Returns 34.3 which is the correct product!<br /> println(3.5*9.4+7/5.0) // Also returns 34.3 which is also correct!</p> <p>So it appears that the 7 isn't being converted into a float. I can live with this bug, but just wanted to let everyone know that to be on the safe bet not to mix floats with integers until this gets correct. Take care now and have a good day!</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-1305918#post-2350089</guid>
				<title>Problem with the Scala Tutorial and perhaps Kojo itself.</title>
				<link>http://kogics.wikidot.com/forum/t-1305918/problem-with-the-scala-tutorial-and-perhaps-kojo-itself#post-2350089</link>
				<description></description>
				<pubDate>Sat, 01 Aug 2015 18:33:11 +0000</pubDate>
				<wikidot:authorName>Darin Lee Murphy</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>Kojo 2.4 Beta Version: 2.4.06 r41 Build date: 20 Apr 2015 Java version: 1.8.0_51-64bit. Scala version: 2.11.6</p> <p>Following &quot;Expressions&quot; section under the Scala tutorial, which is under Kojo's Help menu and ran the expression 3.5*9.4+7/5, which returned 33.9, I've repeated tried this expression using both Windows 7 calculator and Google search and the number I am getting from them is 34.3, which means either Kojo has a problem or the world as a problem. I have also tried just running it like this: println((3.5*9.4)+(7/5)), but again the result Kojo returns is 33.9. Perhaps I do not understand how the &quot;order of operation&quot; Kojo is performing, but I've tried it several ways got different results of course, but never got 33.9. Please look into this issue and let me know whether I am not understanding something or if there is a bug in Kojo. I really think Kojo is a great system overall, but if it's a calculation bug then it needs to be address. Thanks and have a great day!</p> 
				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>