<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FLemondoge%2FCalc%2Fdoc</id>
	<title>Module:Sandbox/Lemondoge/Calc/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FLemondoge%2FCalc%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/Lemondoge/Calc/doc&amp;action=history"/>
	<updated>2026-05-25T20:30:15Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:Sandbox/Lemondoge/Calc/doc&amp;diff=145724&amp;oldid=prev</id>
		<title>imported&gt;WOSlinker: change source to syntaxhighlight</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/Lemondoge/Calc/doc&amp;diff=145724&amp;oldid=prev"/>
		<updated>2020-08-21T07:41:39Z</updated>

		<summary type="html">&lt;p&gt;change source to syntaxhighlight&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;!-- Please place categories where indicated at the bottom of this module and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --&amp;gt;&lt;br /&gt;
== Usage ==&lt;br /&gt;
Performs a calculation.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{&amp;lt;/nowiki&amp;gt;#invoke:{{BASEPAGENAME}}|&amp;#039;&amp;#039;add&amp;#039;&amp;#039;|5|8}}&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Sandbox/Lemondoge/Calc|add|3|6}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; returns {{#invoke:Sandbox/Lemondoge/Calc|add|3|6}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Sandbox/Lemondoge/Calc|minus|6|3}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; returns {{#invoke:Sandbox/Lemondoge/Calc|minus|6|3}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Sandbox/Lemondoge/Calc|mod|3|15}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; returns {{#invoke:Sandbox/Lemondoge/Calc|mod|3|15}}&lt;br /&gt;
&lt;br /&gt;
== Error detection ==&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;times&amp;quot; function (but not the VERY similar &amp;quot;multiplication&amp;quot; function) will return a error like this: &amp;quot;{{#invoke:Sandbox/Lemondoge/Calc|times|0|0|0}}&amp;quot;, if the second parameter is 0, unless the third parameter is set to 1. This works by using the code below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if num2 == 0 and errordetect ~= 1 then&lt;br /&gt;
   return RError(&amp;quot;You cannot multiply a number by zero.&amp;quot;)&lt;br /&gt;
else&lt;br /&gt;
   return num1 * num2&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Anti-not-a-number mechanism ==&lt;br /&gt;
The &amp;quot;division&amp;quot; function (and it&amp;#039;s similar &amp;quot;div&amp;quot; function) will normally return &amp;quot;{{#invoke:Sandbox/Lemondoge/Calc|div|0|0|0}}&amp;quot; if all 3 parameters are set to 0, but if the third parameter is 1, it will return &amp;quot;{{#invoke:Sandbox/Lemondoge/Calc|div|0|0|1}}&amp;quot; instead. This works with the code below:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if num1 == 0 and num2 == 0 and antinotanumber == 1 then&lt;br /&gt;
		return 1&lt;br /&gt;
	else&lt;br /&gt;
		return num1 / num2&lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{#ifeq:{{SUBPAGENAME}}|sandbox | |&lt;br /&gt;
&amp;lt;!-- Categories below this line, please; interwikis at Wikidata --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>imported&gt;WOSlinker</name></author>
	</entry>
</feed>