<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://nethackwiki.com/index.php?action=history&amp;feed=atom&amp;title=User_talk%3ASeen</id>
	<title>User talk:Seen - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://nethackwiki.com/index.php?action=history&amp;feed=atom&amp;title=User_talk%3ASeen"/>
	<link rel="alternate" type="text/html" href="https://nethackwiki.com/index.php?title=User_talk:Seen&amp;action=history"/>
	<updated>2026-08-03T04:59:36Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://nethackwiki.com/index.php?title=User_talk:Seen&amp;diff=10092&amp;oldid=prev</id>
		<title>Stefanor: Patch for &quot;Javascript Casting Failure Calculator&quot;, appears to fix bug</title>
		<link rel="alternate" type="text/html" href="https://nethackwiki.com/index.php?title=User_talk:Seen&amp;diff=10092&amp;oldid=prev"/>
		<updated>2006-09-09T05:47:11Z</updated>

		<summary type="html">&lt;p&gt;Patch for &amp;quot;Javascript Casting Failure Calculator&amp;quot;, appears to fix bug&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Is this the problem (with the Javascript Casting Failure Calculator)?==&lt;br /&gt;
The following seems to fix the problem for me:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--- /tmp/casting.html.orig 2006-09-08 20:40:15.000000000 -0700&lt;br /&gt;
+++ /tmp/casting.html 2006-09-08 20:53:48.000000000 -0700&lt;br /&gt;
@@ -48,7 +48,7 @@&lt;br /&gt;
     var chance = basechance - Math.floor(Math.sqrt(900 * diff + 2000));&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
-    var learning = 15 * Math.floor(-diff / slevel);&lt;br /&gt;
+    var learning = Math.floor(((-15) * diff) / slevel);&lt;br /&gt;
     var chance = basechance + Math.min(learning, 20);&lt;br /&gt;
   }&lt;br /&gt;
   // limit to the 0-120 range&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Since multiplication and division are left associative in C, the multiplication is performed before the division and its implied rounding; this gives the computation slightly more precision than it would have if the division and rounding were done first.&lt;br /&gt;
--[[User:Stefanor|Stefanor]] 05:47, 9 September 2006 (UTC)&lt;/div&gt;</summary>
		<author><name>Stefanor</name></author>
	</entry>
</feed>