Template talk:Add

From Virtualsoil

Simple computations

For a MediaWiki extension, currently not implemented in Wikimedia projects, providing an alternative method of performing simple calculations, see Calc.

Simple additions and multiplications can be performed based on concatenation, using the unary numeral system: when 2 is represented by 11 and 3 by 111, then concatenation gives 11111, which can be converted to 5, see m:Template:Add (talk, backlinks, edit) and m:Template:Multiply (talk, backlinks, edit). An additional parameter allows not only to display the result 5, but also to call a template of choice with parameter 5.

Required auxiliary templates:

In view of the maximum length of 255 for page names, the maximum result can be 250.

Note that for any computation one can prepare an array with all results, but the amount of work to do that is proportional to the number of pairs (m,n) that one wants to use, while above the amount of work is only proportional to the sum of the number of values of m, n, and r.

Personal tools