<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://de.wikijournal.org/w-wiki/index.php?action=history&amp;feed=atom&amp;title=Modul%3AExpr</id>
	<title>Modul:Expr - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://de.wikijournal.org/w-wiki/index.php?action=history&amp;feed=atom&amp;title=Modul%3AExpr"/>
	<link rel="alternate" type="text/html" href="https://de.wikijournal.org/w-wiki/index.php?title=Modul:Expr&amp;action=history"/>
	<updated>2026-04-19T09:47:46Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in WikiJournal</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://de.wikijournal.org/w-wiki/index.php?title=Modul:Expr&amp;diff=346&amp;oldid=prev</id>
		<title>Philip: 1 Version importiert</title>
		<link rel="alternate" type="text/html" href="https://de.wikijournal.org/w-wiki/index.php?title=Modul:Expr&amp;diff=346&amp;oldid=prev"/>
		<updated>2025-02-05T07:45:01Z</updated>

		<summary type="html">&lt;p&gt;1 Version importiert&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 5. Februar 2025, 10:45 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;de&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(kein Unterschied)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wikijournal_org-de__:diff:1.41:old-345:rev-346 --&gt;
&lt;/table&gt;</summary>
		<author><name>Philip</name></author>
	</entry>
	<entry>
		<id>https://de.wikijournal.org/w-wiki/index.php?title=Modul:Expr&amp;diff=345&amp;oldid=prev</id>
		<title>de__&gt;Antonsusi am 21. September 2024 um 00:22 Uhr</title>
		<link rel="alternate" type="text/html" href="https://de.wikijournal.org/w-wiki/index.php?title=Modul:Expr&amp;diff=345&amp;oldid=prev"/>
		<updated>2024-09-21T00:22:49Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 21. September 2024, 03:22 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l956&quot;&gt;Zeile 956:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 956:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         return tostring(value);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         return tostring(value);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     else&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     else&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         return &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&amp;lt;span class=&quot;&lt;/del&gt;error&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot;&amp;gt;Funktion Ramanujan in Modul Expr: ungültige Parameter!&amp;lt;/span&amp;gt;&#039;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         return &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;-1 -- An &lt;/ins&gt;error &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wikijournal_org-de__:diff:1.41:old-161:rev-345:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>de__&gt;Antonsusi</name></author>
	</entry>
	<entry>
		<id>https://de.wikijournal.org/w-wiki/index.php?title=Modul:Expr&amp;diff=161&amp;oldid=prev</id>
		<title>Admin: Die Seite wurde neu angelegt: „local Expr = { suite  = &quot;Expr&quot;,                serial = &quot;2022-09-12&quot;,                item   = 54991461 } --[==[ Expr * average * base62 * crossTotal * decimal2minsec * figure * max * min * minsec2decimal * modulo * percent * Ramanujan * random * sum * TemplateAverage * TemplateBooland * TemplateBoolor * TemplateMax * TemplateMin * TemplateSum ]==] local Failsafe = Expr    Expr.messagePrefix = &quot;lua-module-Expr-&quot; Expr.l10nDef = {} Expr.l10nDef[ &quot;en&quot; ] = {…“</title>
		<link rel="alternate" type="text/html" href="https://de.wikijournal.org/w-wiki/index.php?title=Modul:Expr&amp;diff=161&amp;oldid=prev"/>
		<updated>2023-03-23T15:09:28Z</updated>

		<summary type="html">&lt;p&gt;Die Seite wurde neu angelegt: „local Expr = { suite  = &amp;quot;Expr&amp;quot;,                serial = &amp;quot;2022-09-12&amp;quot;,                item   = 54991461 } --[==[ Expr * average * base62 * crossTotal * decimal2minsec * figure * max * min * minsec2decimal * modulo * percent * Ramanujan * random * sum * TemplateAverage * TemplateBooland * TemplateBoolor * TemplateMax * TemplateMin * TemplateSum ]==] local Failsafe = Expr    Expr.messagePrefix = &amp;quot;lua-module-Expr-&amp;quot; Expr.l10nDef = {} Expr.l10nDef[ &amp;quot;en&amp;quot; ] = {…“&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local Expr = { suite  = &amp;quot;Expr&amp;quot;,&lt;br /&gt;
               serial = &amp;quot;2022-09-12&amp;quot;,&lt;br /&gt;
               item   = 54991461 }&lt;br /&gt;
--[==[&lt;br /&gt;
Expr&lt;br /&gt;
* average&lt;br /&gt;
* base62&lt;br /&gt;
* crossTotal&lt;br /&gt;
* decimal2minsec&lt;br /&gt;
* figure&lt;br /&gt;
* max&lt;br /&gt;
* min&lt;br /&gt;
* minsec2decimal&lt;br /&gt;
* modulo&lt;br /&gt;
* percent&lt;br /&gt;
* Ramanujan&lt;br /&gt;
* random&lt;br /&gt;
* sum&lt;br /&gt;
* TemplateAverage&lt;br /&gt;
* TemplateBooland&lt;br /&gt;
* TemplateBoolor&lt;br /&gt;
* TemplateMax&lt;br /&gt;
* TemplateMin&lt;br /&gt;
* TemplateSum&lt;br /&gt;
]==]&lt;br /&gt;
local Failsafe = Expr&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expr.messagePrefix = &amp;quot;lua-module-Expr-&amp;quot;&lt;br /&gt;
Expr.l10nDef = {}&lt;br /&gt;
Expr.l10nDef[ &amp;quot;en&amp;quot; ] = {&lt;br /&gt;
    ErrorExpr  = &amp;quot;Error in mathematical expression, function#parameter&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
Expr.l10nDef[ &amp;quot;de&amp;quot; ]  = {&lt;br /&gt;
    ErrorExpr  = &amp;quot;Fehler in mathematischem Ausdruck, Funktion#Parameter&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
Expr.breakFigures = { [&amp;quot;,&amp;quot;]      = &amp;quot;,&amp;quot;,&lt;br /&gt;
                      [&amp;quot;.&amp;quot;]      = &amp;quot;%.&amp;quot;,&lt;br /&gt;
                      [&amp;quot;&amp;#039;&amp;quot;]      = &amp;quot;&amp;#039;&amp;quot;,&lt;br /&gt;
                      [&amp;quot;&amp;#039;,&amp;quot;]     = &amp;quot;[&amp;#039;,]&amp;quot;,&lt;br /&gt;
                      [&amp;quot;&amp;#039;.&amp;quot;]     = &amp;quot;[&amp;#039;%.]&amp;quot;,&lt;br /&gt;
                      [&amp;quot;U+20&amp;quot;]   = &amp;quot; &amp;quot;,&lt;br /&gt;
                      [&amp;quot;U+A0&amp;quot;]   = mw.ustring.char( 0xA0 ),&lt;br /&gt;
                      [&amp;quot;U+202F&amp;quot;] = mw.ustring.char( 0x202F ),&lt;br /&gt;
                      [&amp;quot;%s&amp;quot;]     = mw.ustring.char( 91, 0x20,&lt;br /&gt;
                                                        0xA0,&lt;br /&gt;
                                                        0x2009,&lt;br /&gt;
                                                        0x202F, 93 ),&lt;br /&gt;
                      [&amp;quot;.%s&amp;quot;]    = mw.ustring.char( 91, 0x20,&lt;br /&gt;
                                                        0x2E,&lt;br /&gt;
                                                        0xA0,&lt;br /&gt;
                                                        0x2009,&lt;br /&gt;
                                                        0x202F, 93 ),&lt;br /&gt;
                      [&amp;quot;&amp;#039;%s&amp;quot;]    = mw.ustring.char( 91, 0x20,&lt;br /&gt;
                                                        0x27,&lt;br /&gt;
                                                        0xA0,&lt;br /&gt;
                                                        0x2009,&lt;br /&gt;
                                                        0x202F, 93 ),&lt;br /&gt;
                      [&amp;quot;&amp;#039;.%s&amp;quot;]   = mw.ustring.char( 91, 0x20,&lt;br /&gt;
                                                        0x27,&lt;br /&gt;
                                                        0x2E,&lt;br /&gt;
                                                        0xA0,&lt;br /&gt;
                                                        0x2009,&lt;br /&gt;
                                                        0x202F, 93 )&lt;br /&gt;
                    }&lt;br /&gt;
Expr.signMinus = mw.ustring.char( 0x2212 )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local function factory( say )&lt;br /&gt;
    -- Retrieve localized message string in content language&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     say  -- string, message ID&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     Return some message string&lt;br /&gt;
    -- Uses:&lt;br /&gt;
    --     &amp;gt;  Expr.messagePrefix&lt;br /&gt;
    --     &amp;gt;  Expr.l10nDef&lt;br /&gt;
    --     mw.language.getContentLanguage()&lt;br /&gt;
    --     mw.message.new()&lt;br /&gt;
    local slang = mw.language.getContentLanguage():getCode()&lt;br /&gt;
    local msg = mw.message.new( Expr.messagePrefix .. say )&lt;br /&gt;
    local r = false&lt;br /&gt;
    if msg:isBlank() then&lt;br /&gt;
        local def = Expr.l10nDef[ slang ]&lt;br /&gt;
        if not def then&lt;br /&gt;
            def = Expr.l10nDef[ &amp;quot;en&amp;quot; ]&lt;br /&gt;
        end&lt;br /&gt;
        r = def[ say ]&lt;br /&gt;
    else&lt;br /&gt;
        msg:inLanguage( slang )&lt;br /&gt;
        r = msg:plain()&lt;br /&gt;
    end&lt;br /&gt;
    if not r then&lt;br /&gt;
        r = &amp;quot;(((&amp;quot; .. say .. &amp;quot;)))&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end -- factory()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local function faculty( analyze )&lt;br /&gt;
    -- Test for boolean interpretation&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     analyze  -- string or boolean or nil&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     returns boolean&lt;br /&gt;
    local s = type( analyze )&lt;br /&gt;
    local r&lt;br /&gt;
    if s == &amp;quot;string&amp;quot; then&lt;br /&gt;
        r = mw.text.trim( analyze )&lt;br /&gt;
        if r == &amp;quot;&amp;quot;  or  r == &amp;quot;0&amp;quot;  or  r == &amp;quot;-&amp;quot; then&lt;br /&gt;
            r = false&lt;br /&gt;
        elseif r == &amp;quot;1&amp;quot; then&lt;br /&gt;
            r = true&lt;br /&gt;
        else&lt;br /&gt;
            r = r:lower()&lt;br /&gt;
            if r == &amp;quot;y&amp;quot;  or&lt;br /&gt;
               r == &amp;quot;yes&amp;quot;  or&lt;br /&gt;
               r == &amp;quot;true&amp;quot;  or&lt;br /&gt;
               r == &amp;quot;on&amp;quot; then&lt;br /&gt;
                r = true&lt;br /&gt;
            elseif r == &amp;quot;n&amp;quot;  or&lt;br /&gt;
                   r == &amp;quot;no&amp;quot;  or&lt;br /&gt;
                   r == &amp;quot;false&amp;quot;  or&lt;br /&gt;
                   r == &amp;quot;off&amp;quot; then&lt;br /&gt;
                r = false&lt;br /&gt;
            else&lt;br /&gt;
                if r == &amp;quot;falsch&amp;quot;  or  r == &amp;quot;nein&amp;quot; then&lt;br /&gt;
                    r = false&lt;br /&gt;
                    --    error( &amp;quot;faculty@Expr&amp;quot;, 0 )&lt;br /&gt;
                else&lt;br /&gt;
                    r = true&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    elseif s == &amp;quot;boolean&amp;quot; then&lt;br /&gt;
        r = analyze&lt;br /&gt;
    elseif s == &amp;quot;nil&amp;quot; then&lt;br /&gt;
        r = false&lt;br /&gt;
    else&lt;br /&gt;
        r = true&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end -- faculty()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local function expr( source, show )&lt;br /&gt;
    -- Safe evaluation of presumable expression&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     source  -- string, mathematical expression&lt;br /&gt;
    --     show    -- string, details about source&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     throws error, if expression failed&lt;br /&gt;
    --     returns number with resulting figure&lt;br /&gt;
    -- Uses:&lt;br /&gt;
    --     factory()&lt;br /&gt;
    local lucky, r = pcall( mw.ext.ParserFunctions.expr, source )&lt;br /&gt;
    local n = tonumber( r, 10 )&lt;br /&gt;
    if not ( lucky and n ) then&lt;br /&gt;
        r = r .. &amp;quot; &amp;quot; .. factory( &amp;quot;ErrorExpr&amp;quot; )&lt;br /&gt;
            .. &amp;quot; &amp;#039;&amp;#039;&amp;quot; .. show .. &amp;quot;&amp;#039;&amp;#039; (&amp;quot; .. source .. &amp;quot;)&amp;quot;&lt;br /&gt;
        error( r, 0 )&lt;br /&gt;
    else&lt;br /&gt;
        r = n&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end -- expr()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local function ellipse( a, epsilon )&lt;br /&gt;
    -- Circumference of an ellipse. Approximation by Ramanujan&amp;#039;s formula.&lt;br /&gt;
    -- Returns the approximation and a locical value (true, if the data is well)&lt;br /&gt;
    epsilon = tonumber(epsilon) or false;&lt;br /&gt;
    a = tonumber(a) or false;&lt;br /&gt;
    if not epsilon then return 0, false; end&lt;br /&gt;
    if not a then return 0, false; end&lt;br /&gt;
    if epsilon &amp;lt; 0 or epsilon &amp;gt; 1 then return 0, false; end&lt;br /&gt;
    a = math.abs(a);&lt;br /&gt;
&lt;br /&gt;
    local b = a * math.sqrt (1 - epsilon * epsilon);&lt;br /&gt;
    local lambda = (a - b) / (a + b);&lt;br /&gt;
    local circumference = math.pi * (a + b) * (1 + (3 * lambda * lambda)/(10 + math.sqrt (4 - 3 * lambda * lambda)));&lt;br /&gt;
    if circumference then&lt;br /&gt;
        return  circumference, true;&lt;br /&gt;
    else&lt;br /&gt;
        return 0, false;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local function logicaland( args )&lt;br /&gt;
    local r = &amp;quot;&amp;quot;&lt;br /&gt;
    for k, v in pairs( args ) do&lt;br /&gt;
        if mw.text.trim( v ) == &amp;quot;&amp;quot; then&lt;br /&gt;
            r = &amp;quot;&amp;quot;&lt;br /&gt;
            break    -- for k, v&lt;br /&gt;
        else&lt;br /&gt;
            r = &amp;quot;1&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
    end    -- for k, v&lt;br /&gt;
    return r&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local function logicalor( args )&lt;br /&gt;
    local r = &amp;quot;&amp;quot;&lt;br /&gt;
    for k, v in pairs( args ) do&lt;br /&gt;
        if faculty( v ) then&lt;br /&gt;
            r = &amp;quot;1&amp;quot;&lt;br /&gt;
            break    -- for k, v&lt;br /&gt;
        end&lt;br /&gt;
    end    -- for k, v&lt;br /&gt;
    return r&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local function minmax( params, low, lazy  )&lt;br /&gt;
    -- Find extremum of unnamed params values&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     params  -- table, like args&lt;br /&gt;
    --                       .minus&lt;br /&gt;
    --                       .zeroBlank&lt;br /&gt;
    --     low     -- true: minimum,  false: maximum&lt;br /&gt;
    --     lazy    -- true: try numeric result,  false: return string&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     throws error, if expression failed&lt;br /&gt;
    --     returns number, or&lt;br /&gt;
    --             string if formatting required, or&lt;br /&gt;
    --             false if no data provided&lt;br /&gt;
    -- Uses:&lt;br /&gt;
    --     &amp;gt;  Expr.signMinus&lt;br /&gt;
    --     expr()&lt;br /&gt;
    local light  = ( params.minus ~= &amp;quot;-&amp;quot; )&lt;br /&gt;
    local luxury = ( params.minus and light )&lt;br /&gt;
    local r      = false&lt;br /&gt;
    local n, scope&lt;br /&gt;
    for k, v in pairs( params ) do&lt;br /&gt;
        if type( k ) == &amp;quot;number&amp;quot; then&lt;br /&gt;
            scope = type( v )&lt;br /&gt;
            if scope == &amp;quot;string&amp;quot; then&lt;br /&gt;
                v = mw.text.trim( v )&lt;br /&gt;
                if v == &amp;quot;&amp;quot; then&lt;br /&gt;
                    n = false&lt;br /&gt;
                else&lt;br /&gt;
                    if mw.ustring.sub( v, 1, 1 ) == Expr.signMinus then&lt;br /&gt;
                        luxury = light&lt;br /&gt;
                        v      = &amp;quot;-&amp;quot; .. mw.ustring.sub( v, 2 )&lt;br /&gt;
                    end&lt;br /&gt;
                    n = Expr.figure( v, &amp;quot;.&amp;quot;, true )&lt;br /&gt;
                    if not n then&lt;br /&gt;
                        if low then&lt;br /&gt;
                            scope = &amp;quot;min()#&amp;quot;&lt;br /&gt;
                        else&lt;br /&gt;
                            scope = &amp;quot;max()#&amp;quot;&lt;br /&gt;
                        end&lt;br /&gt;
                        scope = scope .. tostring( k )&lt;br /&gt;
                        expr( v, scope )&lt;br /&gt;
                    end&lt;br /&gt;
                end&lt;br /&gt;
            elseif scope == &amp;quot;number&amp;quot; then&lt;br /&gt;
                n = v&lt;br /&gt;
            else&lt;br /&gt;
                n = false&lt;br /&gt;
            end&lt;br /&gt;
            if n then&lt;br /&gt;
                if r then&lt;br /&gt;
                    if low then&lt;br /&gt;
                        if n &amp;lt; r then&lt;br /&gt;
                            r = n&lt;br /&gt;
                        end&lt;br /&gt;
                    else&lt;br /&gt;
                        if n &amp;gt; r then&lt;br /&gt;
                            r = n&lt;br /&gt;
                        end&lt;br /&gt;
                    end&lt;br /&gt;
                else&lt;br /&gt;
                    r = n&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end -- for k, v&lt;br /&gt;
    if r then&lt;br /&gt;
        if luxury and r &amp;lt; 0 then&lt;br /&gt;
            r = Expr.signMinus .. tostring( -1 * r )&lt;br /&gt;
        elseif not lazy then&lt;br /&gt;
            if r == 0 then&lt;br /&gt;
                if params.zeroBlank then&lt;br /&gt;
                    r = &amp;quot;&amp;quot;&lt;br /&gt;
                else&lt;br /&gt;
                    r = &amp;quot;0&amp;quot;&lt;br /&gt;
                end&lt;br /&gt;
            else&lt;br /&gt;
                r = tostring( r )&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end -- minmax()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expr.average = function ( array, ask )&lt;br /&gt;
    -- Calculate average&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     array  -- sequence table, with strings and/or numbers&lt;br /&gt;
    --     ask    -- string or not, with figure format&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     returns number, at least 0&lt;br /&gt;
    local r, n = Expr.sum( array, ask )&lt;br /&gt;
    if n &amp;gt; 1 then&lt;br /&gt;
        r = r / n&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end -- Expr.average()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expr.base62 = function ( adjust )&lt;br /&gt;
    -- Convert number from and to base62 encoding&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     adjust  -- number or ASCII string to be converted&lt;br /&gt;
    --                number: to base62&lt;br /&gt;
    --                string: base62 to number&lt;br /&gt;
    --     Lua limitation at 10^53; larger numbers are less precise&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     returns string, or number, or false&lt;br /&gt;
    local r     = false&lt;br /&gt;
    local state = type( adjust )&lt;br /&gt;
    if state == &amp;quot;number&amp;quot; then&lt;br /&gt;
        local k = math.floor( adjust )&lt;br /&gt;
        if k == adjust  and  adjust &amp;gt; 0 then&lt;br /&gt;
            local m&lt;br /&gt;
            r = &amp;quot;&amp;quot;&lt;br /&gt;
            while k &amp;gt; 0 do&lt;br /&gt;
                m = k % 62&lt;br /&gt;
                k = ( k - m ) / 62&lt;br /&gt;
                if m &amp;gt;= 36 then&lt;br /&gt;
                    m = m + 61&lt;br /&gt;
                elseif m &amp;gt;= 11 then&lt;br /&gt;
                    m = m + 55&lt;br /&gt;
                else&lt;br /&gt;
                    m = m + 48&lt;br /&gt;
                end&lt;br /&gt;
                r = string.char( m ) .. r&lt;br /&gt;
            end&lt;br /&gt;
        elseif adjust == 0 then&lt;br /&gt;
            r = &amp;quot;0&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
    elseif state == &amp;quot;string&amp;quot; then&lt;br /&gt;
        if adjust:match( &amp;quot;^%w+$&amp;quot; ) then&lt;br /&gt;
            local n = #adjust&lt;br /&gt;
            local k = 1&lt;br /&gt;
            local c&lt;br /&gt;
            r = 0&lt;br /&gt;
            for i = n, 1, -1 do&lt;br /&gt;
                c = adjust:byte( i, i )&lt;br /&gt;
                if c &amp;gt;= 48  and  c &amp;lt;= 57 then&lt;br /&gt;
                    c = c - 48&lt;br /&gt;
                elseif c &amp;gt;= 65  and  c &amp;lt;= 90 then&lt;br /&gt;
                    c = c - 55&lt;br /&gt;
                elseif c &amp;gt;= 97  and  c &amp;lt;= 122 then&lt;br /&gt;
                    c = c - 61&lt;br /&gt;
                else    -- How comes?&lt;br /&gt;
                    r = nil&lt;br /&gt;
                    break    -- for i&lt;br /&gt;
                end&lt;br /&gt;
                r = r + c * k&lt;br /&gt;
                k = k * 62&lt;br /&gt;
            end -- for i&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end -- Expr.base62()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expr.crossTotal = function ( amount )&lt;br /&gt;
    -- Calculate sum of digits in integer number&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     amount  -- string or number, with integer&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     returns number, at least 0&lt;br /&gt;
    local r = 0&lt;br /&gt;
    local s = Expr.figure( amount )&lt;br /&gt;
    if s then&lt;br /&gt;
        if s &amp;lt; 0 then&lt;br /&gt;
            s = -1 * s&lt;br /&gt;
        end&lt;br /&gt;
        s = tostring( math.floor( s ) )&lt;br /&gt;
        if s:match( &amp;quot;^%d+$&amp;quot; ) then&lt;br /&gt;
            for i = 1, #s do&lt;br /&gt;
                r = r  +  tonumber( s:sub( i, i ) )&lt;br /&gt;
            end -- for i&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end -- Expr.crossTotal()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expr.decimal2minsec = function ( amount, align, ask, allow, frame )&lt;br /&gt;
    -- Format coordinate value in degree, minutes, seconds&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     amount  -- string or number, with decimal coordinate&lt;br /&gt;
    --     align   -- string, number, nil, with number of decimal digits&lt;br /&gt;
    --     ask     -- string or not, with figure format&lt;br /&gt;
    --     allow   -- true, if unformatted result&lt;br /&gt;
    --     frame   -- object, if available&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     returns  mw.html  -- with formatted data, or&lt;br /&gt;
    --              string   -- with &amp;quot;0&amp;quot; if any problem&lt;br /&gt;
    -- Uses:&lt;br /&gt;
    --     &amp;gt;  Expr.signMinus&lt;br /&gt;
    local r = Expr.figure( amount, ask )&lt;br /&gt;
    if r then&lt;br /&gt;
        local d = tonumber( align )&lt;br /&gt;
        local e = mw.html.create( &amp;quot;span&amp;quot; )&lt;br /&gt;
        local kd, km, low, sd&lt;br /&gt;
        if r &amp;lt; 0 then&lt;br /&gt;
            low = true&lt;br /&gt;
            r   = -1 * r&lt;br /&gt;
        end&lt;br /&gt;
        kd = math.floor( r )&lt;br /&gt;
        r  = ( r - kd )  *  60&lt;br /&gt;
        if kd &amp;gt; 360 then&lt;br /&gt;
            kd = kd   -   math.floor( kd / 360 )  *  360&lt;br /&gt;
        end&lt;br /&gt;
        sd = tostring( kd )&lt;br /&gt;
        if low then&lt;br /&gt;
            sd = Expr.signMinus .. sd&lt;br /&gt;
        end&lt;br /&gt;
        km = math.floor( r )&lt;br /&gt;
        r  = ( r - km )  *  60&lt;br /&gt;
        if d  and  d &amp;gt;= 1  and  d &amp;lt; 10 then&lt;br /&gt;
            local n = math.floor( r )&lt;br /&gt;
            if r == n then&lt;br /&gt;
                r = tostring( n )&lt;br /&gt;
            else&lt;br /&gt;
                local s = string.format( &amp;quot;%%.%df&amp;quot;, math.floor( d ) )&lt;br /&gt;
                r = tonumber( string.format( s, r ) )&lt;br /&gt;
                if allow then&lt;br /&gt;
                    r = tostring( r )&lt;br /&gt;
                else&lt;br /&gt;
                    if not Expr.frame then&lt;br /&gt;
                        Expr.frame = frame or mw.getCurrentFrame()&lt;br /&gt;
                    end&lt;br /&gt;
                    r = Expr.frame:callParserFunction( &amp;quot;formatnum&amp;quot;, r )&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            r = tostring( math.floor( r + 0.5 ) )&lt;br /&gt;
        end&lt;br /&gt;
        if not Expr.degminsec then&lt;br /&gt;
            Expr.degminsec = string.format( &amp;quot;%%s%s %%d%s %%s%s&amp;quot;,&lt;br /&gt;
                                            mw.ustring.char( 0xB0 ),&lt;br /&gt;
                                            mw.ustring.char( 0x2032 ),&lt;br /&gt;
                                            mw.ustring.char( 0x2033 ) )&lt;br /&gt;
        end&lt;br /&gt;
        r = string.format( Expr.degminsec, sd, km, r )&lt;br /&gt;
        e:css( &amp;quot;white-space&amp;quot;, &amp;quot;nowrap&amp;quot; )&lt;br /&gt;
         :addClass( &amp;quot;coordinate-deg-min-sec&amp;quot; )&lt;br /&gt;
        e:wikitext( r )&lt;br /&gt;
        r = e&lt;br /&gt;
    else&lt;br /&gt;
        r = &amp;quot;0&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end -- Expr.decimal2minsec()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expr.figure = function ( amount, ask, advance, area )&lt;br /&gt;
    -- Convert number from various formats&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     amount   -- string (or number), with number&lt;br /&gt;
    --     ask      -- string, with permitted formatting, defaults to &amp;quot;.&amp;quot;&lt;br /&gt;
    --     advance  -- true, if expressions permitted&lt;br /&gt;
    --     area     -- string, or not, with permitted set&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     returns  number, or false&lt;br /&gt;
    -- Uses:&lt;br /&gt;
    --     &amp;gt;  Expr.signMinus&lt;br /&gt;
    --     &amp;gt;  Expr.breakFigures&lt;br /&gt;
    -- 2022-08-08&lt;br /&gt;
    local seek = type( amount )&lt;br /&gt;
    local r&lt;br /&gt;
    if seek == &amp;quot;string&amp;quot; then&lt;br /&gt;
        local scan = mw.text.trim( amount )&lt;br /&gt;
        seek = ask or &amp;quot;.&amp;quot;&lt;br /&gt;
        if scan == &amp;quot;&amp;quot; then&lt;br /&gt;
            seek = false&lt;br /&gt;
        elseif advance  and&lt;br /&gt;
               not tonumber( scan ) and&lt;br /&gt;
               scan:find( &amp;quot;[+%-*/)]&amp;quot;, 2 ) then&lt;br /&gt;
            local lucky&lt;br /&gt;
            lucky, r = pcall( mw.ext.ParserFunctions.expr, scan )&lt;br /&gt;
            if lucky then&lt;br /&gt;
                seek = false&lt;br /&gt;
                r    = tonumber( r )&lt;br /&gt;
            else&lt;br /&gt;
                r = false&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        if type( seek ) == &amp;quot;string&amp;quot; then&lt;br /&gt;
            if scan:find( &amp;quot;[Ee]&amp;quot; ) then&lt;br /&gt;
                scan = scan:match( &amp;quot;^[+%-]?([%.%d]+)[Ee][+%-]?%d+$&amp;quot; )&lt;br /&gt;
                if scan   and&lt;br /&gt;
                   ( scan:match( &amp;quot;^%.%d+$&amp;quot; )  or&lt;br /&gt;
                     scan:match( &amp;quot;^%d+%.?%d*$&amp;quot; ) ) then&lt;br /&gt;
                    r = tonumber( amount )&lt;br /&gt;
                end&lt;br /&gt;
            else&lt;br /&gt;
                local low, split&lt;br /&gt;
                seek = mw.text.trim( seek )&lt;br /&gt;
                if seek == &amp;quot;&amp;quot; then&lt;br /&gt;
                    seek = &amp;quot;.&amp;quot;&lt;br /&gt;
                end&lt;br /&gt;
                split = seek:sub( -1 )&lt;br /&gt;
                seek  = seek:sub( 1, -2 )&lt;br /&gt;
                if seek:sub( 1, 1 ) == &amp;quot;-&amp;quot; then&lt;br /&gt;
                    seek = seek:sub( 2 )&lt;br /&gt;
                    if mw.ustring.sub( scan, 1, 1 )&lt;br /&gt;
                       == Expr.signMinus then&lt;br /&gt;
                        low  = true&lt;br /&gt;
                        scan = mw.ustring.sub( scan, 2 )&lt;br /&gt;
                    end&lt;br /&gt;
                end&lt;br /&gt;
                if not low then&lt;br /&gt;
                    if scan:sub( 1, 1 ) == &amp;quot;-&amp;quot; then&lt;br /&gt;
                        low  = true&lt;br /&gt;
                        scan = scan:sub( 2 )&lt;br /&gt;
                    elseif scan:sub( 1, 1 ) == &amp;quot;+&amp;quot; then&lt;br /&gt;
                        scan = scan:sub( 2 )&lt;br /&gt;
                    end&lt;br /&gt;
                end&lt;br /&gt;
                if ( split == &amp;quot;.&amp;quot;  or  split == &amp;quot;,&amp;quot; )   and&lt;br /&gt;
                   not  seek:find( split, 1, true ) then&lt;br /&gt;
                    local i = scan:find( split, 1, true )&lt;br /&gt;
                    if i then&lt;br /&gt;
                        split = scan:sub( i + 1 )&lt;br /&gt;
                        if split == &amp;quot;&amp;quot; then&lt;br /&gt;
                            split = false&lt;br /&gt;
                        end&lt;br /&gt;
                        if i &amp;gt; 1 then&lt;br /&gt;
                            r = scan:sub( 1,  i - 1 )&lt;br /&gt;
                        elseif split then&lt;br /&gt;
                            r = &amp;quot;&amp;quot;&lt;br /&gt;
                        else&lt;br /&gt;
                            r = false&lt;br /&gt;
                        end&lt;br /&gt;
                    else&lt;br /&gt;
                        split = false&lt;br /&gt;
                        r     = scan&lt;br /&gt;
                    end&lt;br /&gt;
                    if r then&lt;br /&gt;
                        seek = Expr.breakFigures[ seek ]&lt;br /&gt;
                        if seek then&lt;br /&gt;
                            local f = function ( a )&lt;br /&gt;
                                          local rf = a&lt;br /&gt;
                                          if rf:find( &amp;quot;&amp;amp;.+;&amp;quot; ) then&lt;br /&gt;
                                              rf = mw.text.decode( rf,&lt;br /&gt;
                                                                   true )&lt;br /&gt;
                                          end&lt;br /&gt;
                                          rf = mw.ustring.gsub( rf,&lt;br /&gt;
                                                                seek,&lt;br /&gt;
                                                                &amp;quot;%1%2&amp;quot; )&lt;br /&gt;
                                          return rf&lt;br /&gt;
                                      end&lt;br /&gt;
                            seek = &amp;quot;(%d)&amp;quot; .. seek .. &amp;quot;(%d)&amp;quot;&lt;br /&gt;
                            if r ~= &amp;quot;&amp;quot; then&lt;br /&gt;
                                r = f( r )&lt;br /&gt;
                            end&lt;br /&gt;
                            if split then&lt;br /&gt;
                                split = f( split )&lt;br /&gt;
                            end&lt;br /&gt;
                        end&lt;br /&gt;
                        if split  and&lt;br /&gt;
                           not split:match( &amp;quot;^%d+$&amp;quot; ) then&lt;br /&gt;
                            r = false&lt;br /&gt;
                        end&lt;br /&gt;
                        if r  and&lt;br /&gt;
                           not r:match( &amp;quot;^%d+$&amp;quot; ) then&lt;br /&gt;
                            r = false&lt;br /&gt;
                        end&lt;br /&gt;
                        if r and split then&lt;br /&gt;
                            r = string.format( &amp;quot;%s.%s&amp;quot;, r, split )&lt;br /&gt;
                        end&lt;br /&gt;
                    end&lt;br /&gt;
                end&lt;br /&gt;
                if r then&lt;br /&gt;
                    r = tonumber( r )&lt;br /&gt;
                    if low then&lt;br /&gt;
                        r = -1 * r&lt;br /&gt;
                    end&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    elseif seek == &amp;quot;number&amp;quot; then&lt;br /&gt;
        r = amount&lt;br /&gt;
    end&lt;br /&gt;
    if r  and  type( area ) == &amp;quot;string&amp;quot; then&lt;br /&gt;
        local set = mw.text.trim( area )&lt;br /&gt;
        if set == &amp;quot;&amp;quot; then&lt;br /&gt;
        elseif set == &amp;quot;N&amp;quot;  or  set == &amp;quot;Z+&amp;quot; then&lt;br /&gt;
            if r &amp;lt; 0  or&lt;br /&gt;
               r ~= math.floor( r ) then&lt;br /&gt;
                r = false&lt;br /&gt;
            end&lt;br /&gt;
        elseif set == &amp;quot;Z&amp;quot; then&lt;br /&gt;
            if r ~= math.floor( r ) then&lt;br /&gt;
                r = false&lt;br /&gt;
            end&lt;br /&gt;
        elseif set == &amp;quot;Z-&amp;quot; then&lt;br /&gt;
            if r &amp;gt; 0  or&lt;br /&gt;
               r ~= math.floor( r ) then&lt;br /&gt;
                r = false&lt;br /&gt;
            end&lt;br /&gt;
        elseif set == &amp;quot;R+&amp;quot; then&lt;br /&gt;
            if r &amp;lt; 0 then&lt;br /&gt;
                r = false&lt;br /&gt;
            end&lt;br /&gt;
        elseif set == &amp;quot;R-&amp;quot; then&lt;br /&gt;
            if r &amp;gt; 0 then&lt;br /&gt;
                r = false&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return r or false&lt;br /&gt;
end -- Expr.figure()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expr.minsec2decimal = function ( aDeg, aMin, aSec, alter, ask )&lt;br /&gt;
    -- Convert coordinate value from degree, minutes, seconds, letter&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     aDeg   -- string or number, with degree&lt;br /&gt;
    --     aMin   -- string or number, with minutes&lt;br /&gt;
    --     aSec   -- string or number, with seconds&lt;br /&gt;
    --     alter  -- string or boolean, true|S|W, negative sign&lt;br /&gt;
    --     ask    -- string, with permitted formatting, defaults to &amp;quot;.&amp;quot;&lt;br /&gt;
    local r = Expr.figure( aDeg, ask )&lt;br /&gt;
    if r then&lt;br /&gt;
        local qm = Expr.figure( aMin, ask )&lt;br /&gt;
        local qt = Expr.figure( aSec, ask )&lt;br /&gt;
        local m  = 360&lt;br /&gt;
        local less&lt;br /&gt;
        if qm then&lt;br /&gt;
            r = r  +  qm * 0.0166666666666667&lt;br /&gt;
            if qt then&lt;br /&gt;
                r = r  +  qt * 0.0002777777777777778&lt;br /&gt;
            end&lt;br /&gt;
        elseif qt then&lt;br /&gt;
            r = false&lt;br /&gt;
        end&lt;br /&gt;
        if alter then&lt;br /&gt;
            local s = type( alter )&lt;br /&gt;
            if s == &amp;quot;string&amp;quot; then&lt;br /&gt;
                s = mw.text.trim( alter ):upper()&lt;br /&gt;
                if s == &amp;quot;S&amp;quot;  or  s == &amp;quot;W&amp;quot; then&lt;br /&gt;
                    less = true&lt;br /&gt;
                end&lt;br /&gt;
                if s == &amp;quot;N&amp;quot;  or  s == &amp;quot;S&amp;quot; then&lt;br /&gt;
                    m = 180&lt;br /&gt;
                end&lt;br /&gt;
            elseif s == &amp;quot;boolean&amp;quot; then&lt;br /&gt;
                less = alter&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        if r then&lt;br /&gt;
            if r &amp;lt; 0 then&lt;br /&gt;
                r    = -1 * r&lt;br /&gt;
                less = true&lt;br /&gt;
            end&lt;br /&gt;
            if r &amp;gt; 0 then&lt;br /&gt;
                r = r   -   math.floor( r / m )  *  m&lt;br /&gt;
            end&lt;br /&gt;
            if less then&lt;br /&gt;
                r = -1 * r&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return r or 0&lt;br /&gt;
end -- Expr.minsec2decimal()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expr.modulo = function ( amount, adjust, ask )&lt;br /&gt;
    -- Retrieve modulo remainder&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     amount  -- string or number, with total amount (dividend)&lt;br /&gt;
    --     adjust  -- string or number, with modulo divisor, non-zero&lt;br /&gt;
    --     ask     -- string or not, with figure format&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     returns  number  -- with modulo remainder&lt;br /&gt;
    --              0       -- if numbers are not available&lt;br /&gt;
    local qt = Expr.figure( amount, ask )&lt;br /&gt;
    local qm = Expr.figure( adjust, ask )&lt;br /&gt;
    local r&lt;br /&gt;
    if qt  and  qm  and  qm ~= 0 then&lt;br /&gt;
        r = qt   -   math.floor( qt / qm )  *  qm&lt;br /&gt;
    else&lt;br /&gt;
        r = 0&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end -- Expr.modulo()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expr.percent = function ( amount, all, align, after, ask, allow, frame )&lt;br /&gt;
    -- Retrieve percentage&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     amount  -- string or number, with partial value&lt;br /&gt;
    --     all     -- string or number, with base value (100%)&lt;br /&gt;
    --     align   -- string, number, nil, with number of decimal digits&lt;br /&gt;
    --     after   -- true, if trailing zeroes shall be kept&lt;br /&gt;
    --     ask     -- string or not, with figure format&lt;br /&gt;
    --     allow   -- true, if unformatted result&lt;br /&gt;
    --     frame   -- object, if available&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     returns  string  -- with formatted percentage, terminated by %&lt;br /&gt;
    --              0       -- if numbers are not available&lt;br /&gt;
    local qp = Expr.figure( amount, ask )&lt;br /&gt;
    local qb = Expr.figure( all, ask )&lt;br /&gt;
    local r&lt;br /&gt;
    if qp  and  qb  and  qb ~= 0 then&lt;br /&gt;
        local d = tonumber( align )&lt;br /&gt;
        r = qp * 100 / qb&lt;br /&gt;
        if d  and  d &amp;gt;= 1  and  d &amp;lt; 10 then&lt;br /&gt;
            local s = string.format( &amp;quot;%%.%df&amp;quot;, math.floor( d ) )&lt;br /&gt;
            s = string.format( s, r )&lt;br /&gt;
            if after then&lt;br /&gt;
                r = s&lt;br /&gt;
            else&lt;br /&gt;
                local n = math.floor( r )&lt;br /&gt;
                if tonumber( s ) == n then&lt;br /&gt;
                    r = tostring( n )&lt;br /&gt;
                else&lt;br /&gt;
                    r = s:gsub( &amp;quot;^(-?%d+%.%d*[1-9])0+$&amp;quot;, &amp;quot;%1&amp;quot; )&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            r = tostring( math.floor( r + 0.5 ) )&lt;br /&gt;
        end&lt;br /&gt;
        if not allow then&lt;br /&gt;
            if not Expr.frame then&lt;br /&gt;
                Expr.frame = frame or mw.getCurrentFrame()&lt;br /&gt;
            end&lt;br /&gt;
            r = Expr.frame:callParserFunction( &amp;quot;formatnum&amp;quot;, r )&lt;br /&gt;
        end&lt;br /&gt;
        r = r .. &amp;quot; %&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
        r = 0&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end -- Expr.percent()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expr.sum = function ( array, ask )&lt;br /&gt;
    -- Calculate sum&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     array  -- sequence table, with strings and/or numbers&lt;br /&gt;
    --     ask    -- string or not, with figure format&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     returns    -- 1, number, with sum, at least 0&lt;br /&gt;
    --                -- 2, number, of summands, at least 0&lt;br /&gt;
    local r1 = 0&lt;br /&gt;
    local r2 = 0&lt;br /&gt;
    if type( array ) == &amp;quot;table&amp;quot; then&lt;br /&gt;
        for k, v in pairs( array ) do&lt;br /&gt;
            v = Expr.figure( v, ask, true )&lt;br /&gt;
            if v then&lt;br /&gt;
                r1 = r1 + v&lt;br /&gt;
                r2 = r2 + 1&lt;br /&gt;
            end&lt;br /&gt;
        end -- for k, v&lt;br /&gt;
    end&lt;br /&gt;
    return r1, r2&lt;br /&gt;
end -- Expr.sum()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Failsafe.failsafe = function ( atleast )&lt;br /&gt;
    -- Retrieve versioning and check for compliance&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     atleast  -- string, with required version&lt;br /&gt;
    --                         or wikidata|item|~|@ or false&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     returns  string  -- with queried version/item, also if problem&lt;br /&gt;
    --              false   -- if appropriate&lt;br /&gt;
    -- 2020-08-17&lt;br /&gt;
    local since  = atleast&lt;br /&gt;
    local last   = ( since == &amp;quot;~&amp;quot; )&lt;br /&gt;
    local linked = ( since == &amp;quot;@&amp;quot; )&lt;br /&gt;
    local link   = ( since == &amp;quot;item&amp;quot; )&lt;br /&gt;
    local r&lt;br /&gt;
    if last  or  link  or  linked  or  since == &amp;quot;wikidata&amp;quot; then&lt;br /&gt;
        local item = Failsafe.item&lt;br /&gt;
        since = false&lt;br /&gt;
        if type( item ) == &amp;quot;number&amp;quot;  and  item &amp;gt; 0 then&lt;br /&gt;
            local suited = string.format( &amp;quot;Q%d&amp;quot;, item )&lt;br /&gt;
            if link then&lt;br /&gt;
                r = suited&lt;br /&gt;
            else&lt;br /&gt;
                local entity = mw.wikibase.getEntity( suited )&lt;br /&gt;
                if type( entity ) == &amp;quot;table&amp;quot; then&lt;br /&gt;
                    local seek = Failsafe.serialProperty or &amp;quot;P348&amp;quot;&lt;br /&gt;
                    local vsn  = entity:formatPropertyValues( seek )&lt;br /&gt;
                    if type( vsn ) == &amp;quot;table&amp;quot;  and&lt;br /&gt;
                       type( vsn.value ) == &amp;quot;string&amp;quot;  and&lt;br /&gt;
                       vsn.value ~= &amp;quot;&amp;quot; then&lt;br /&gt;
                        if last  and  vsn.value == Failsafe.serial then&lt;br /&gt;
                            r = false&lt;br /&gt;
                        elseif linked then&lt;br /&gt;
                            if mw.title.getCurrentTitle().prefixedText&lt;br /&gt;
                               ==  mw.wikibase.getSitelink( suited ) then&lt;br /&gt;
                                r = false&lt;br /&gt;
                            else&lt;br /&gt;
                                r = suited&lt;br /&gt;
                            end&lt;br /&gt;
                        else&lt;br /&gt;
                            r = vsn.value&lt;br /&gt;
                        end&lt;br /&gt;
                    end&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    if type( r ) == &amp;quot;nil&amp;quot; then&lt;br /&gt;
        if not since  or  since &amp;lt;= Failsafe.serial then&lt;br /&gt;
            r = Failsafe.serial&lt;br /&gt;
        else&lt;br /&gt;
            r = false&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end -- Failsafe.failsafe()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- Export&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.average( frame )&lt;br /&gt;
    local d = { }&lt;br /&gt;
    for k, v in pairs( frame.args ) do&lt;br /&gt;
        k = tostring( k )&lt;br /&gt;
        if k:match( &amp;quot;^%d+$&amp;quot; ) then&lt;br /&gt;
            table.insert( d, v )&lt;br /&gt;
        end&lt;br /&gt;
    end -- for k, v&lt;br /&gt;
    return Expr.average( d, frame.args.parse )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.base62( frame )&lt;br /&gt;
    local r&lt;br /&gt;
    local s = frame.args[ 1 ]&lt;br /&gt;
    if s then&lt;br /&gt;
        local s2 = frame.args[ 2 ]&lt;br /&gt;
        if s2 then&lt;br /&gt;
            s2 = mw.text.trim( s2 )&lt;br /&gt;
        end&lt;br /&gt;
        if s2 == &amp;quot;D2B&amp;quot; then&lt;br /&gt;
            s = tonumber( s )&lt;br /&gt;
        else&lt;br /&gt;
            s = mw.text.trim( s )&lt;br /&gt;
            s2 = false&lt;br /&gt;
        end&lt;br /&gt;
        r = Expr.base62( s )&lt;br /&gt;
        if r  and  not s2 then&lt;br /&gt;
            r = string.format( &amp;quot;%17d&amp;quot;, r )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return r or &amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.crossTotal( frame )&lt;br /&gt;
    return Expr.crossTotal( frame.args[ 1 ] )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.decimal2minsec( frame )&lt;br /&gt;
    return  tostring( Expr.decimal2minsec( frame.args[ 1 ],&lt;br /&gt;
                                           frame.args[ 2 ],&lt;br /&gt;
                                           frame.args.parse,&lt;br /&gt;
                                           faculty( frame.args.low ),&lt;br /&gt;
                                           frame ) )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.figure = function ( frame )&lt;br /&gt;
    local r = Expr.figure( frame.args[ 1 ],&lt;br /&gt;
                           frame.args.parse,&lt;br /&gt;
                           faculty( frame.args.expr ),&lt;br /&gt;
                           frame.args.set )&lt;br /&gt;
    if r then&lt;br /&gt;
        r = tostring( r )&lt;br /&gt;
    else&lt;br /&gt;
        r = &amp;quot;&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end -- p.figure&lt;br /&gt;
&lt;br /&gt;
function p.max( frame )&lt;br /&gt;
    local lucky, r = pcall( minmax, frame.args, false, false )&lt;br /&gt;
    return r or &amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.min( frame )&lt;br /&gt;
    local lucky, r = pcall( minmax, frame.args, true, false )&lt;br /&gt;
    return r or &amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.minsec2decimal( frame )&lt;br /&gt;
    return Expr.minsec2decimal( frame.args[ 1 ],&lt;br /&gt;
                                frame.args[ 2 ],&lt;br /&gt;
                                frame.args[ 3 ],&lt;br /&gt;
                                frame.args[ 4 ],&lt;br /&gt;
                                frame.args.parse )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.modulo( frame )&lt;br /&gt;
    return Expr.modulo( frame.args[ 1 ],&lt;br /&gt;
                        frame.args[ 2 ],&lt;br /&gt;
                        frame.args[ 3 ] )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.percent( frame )&lt;br /&gt;
    local base = frame.args[ 2 ]&lt;br /&gt;
    local pars&lt;br /&gt;
    if base then&lt;br /&gt;
        pars = frame.args&lt;br /&gt;
    else&lt;br /&gt;
        pars = frame:getParent().args&lt;br /&gt;
        base = pars[ 2 ]&lt;br /&gt;
    end&lt;br /&gt;
    return Expr.percent( pars[ 1 ],&lt;br /&gt;
                         base,&lt;br /&gt;
                         pars[ 3 ],&lt;br /&gt;
                         faculty( pars[ 4 ] ),&lt;br /&gt;
                         pars.parse,&lt;br /&gt;
                         faculty( pars.low ),&lt;br /&gt;
                         frame )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.Ramanujan( frame )&lt;br /&gt;
    local semiaxis = frame.args[1] or 0;&lt;br /&gt;
    local eps = frame.args[2] or 0;&lt;br /&gt;
    local value, isOk = ellipse( semiaxis,eps );&lt;br /&gt;
    if isOk then&lt;br /&gt;
        return tostring(value);&lt;br /&gt;
    else&lt;br /&gt;
        return &amp;#039;&amp;lt;span class=&amp;quot;error&amp;quot;&amp;gt;Funktion Ramanujan in Modul Expr: ungültige Parameter!&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.random( frame )&lt;br /&gt;
    local n = Expr.figure( frame.args[ 1 ] )&lt;br /&gt;
    if n and n &amp;gt;= 2 then&lt;br /&gt;
        n = math.floor( n )&lt;br /&gt;
    else&lt;br /&gt;
        n = 100&lt;br /&gt;
    end&lt;br /&gt;
    math.randomseed( math.floor( 100000 * os.clock() ) )&lt;br /&gt;
    return math.random( 0,  n - 1 )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.sum( frame )&lt;br /&gt;
    local d = { }&lt;br /&gt;
    local r, n&lt;br /&gt;
    for k, v in pairs( frame.args ) do&lt;br /&gt;
        k = tostring( k )&lt;br /&gt;
        if k:match( &amp;quot;^%d+$&amp;quot; ) then&lt;br /&gt;
            table.insert( d, v )&lt;br /&gt;
        end&lt;br /&gt;
    end -- for k, v&lt;br /&gt;
    r, n = Expr.sum( d, frame.args.parse )&lt;br /&gt;
    return r&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.TemplateAverage( frame )&lt;br /&gt;
    return p.average( frame:getParent() )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.TemplateBooland( frame )&lt;br /&gt;
    return logicaland( frame:getParent().args )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.TemplateBoolor( frame )&lt;br /&gt;
    return logicalor( frame:getParent().args )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.TemplateMax( frame )&lt;br /&gt;
    return p.max( frame:getParent() )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.TemplateMin( frame )&lt;br /&gt;
    return p.min( frame:getParent() )&lt;br /&gt;
end&lt;br /&gt;
function p.TemplateSum( frame )&lt;br /&gt;
    return p.sum( frame:getParent() )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.failsafe = function ( frame )&lt;br /&gt;
    -- Versioning interface&lt;br /&gt;
    local s = type( frame )&lt;br /&gt;
    local since&lt;br /&gt;
    if s == &amp;quot;table&amp;quot; then&lt;br /&gt;
        since = frame.args[ 1 ]&lt;br /&gt;
    elseif s == &amp;quot;string&amp;quot; then&lt;br /&gt;
        since = frame&lt;br /&gt;
    end&lt;br /&gt;
    if since then&lt;br /&gt;
        since = mw.text.trim( since )&lt;br /&gt;
        if since == &amp;quot;&amp;quot; then&lt;br /&gt;
            since = false&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return Failsafe.failsafe( since )  or  &amp;quot;&amp;quot;&lt;br /&gt;
end -- p.failsafe&lt;br /&gt;
&lt;br /&gt;
p.Expr = function ()&lt;br /&gt;
    return Expr&lt;br /&gt;
end -- p.Expr()&lt;br /&gt;
&lt;br /&gt;
setmetatable( p,  { __call = function ( func, ... )&lt;br /&gt;
                                 setmetatable( p, nil );&lt;br /&gt;
                                 return Failsafe;&lt;br /&gt;
                             end } );&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>