Template:Absexpr

From Meta, a Wikimedia project coordination wiki

-(-8)

Version of Template:Abs producing an expression, for further computations without intermediate rounding and without the problem of scientific notation.

{{{{{subst|}}}#ifexpr:({{{1|-8}}})<0|-}}({{{1|-8}}}) (-8 is an example).
{{absexpr|-12345678*12345678}} = -(-12345678*12345678)


The default -8 does not work with substitution:

{{subst:absexpr|subst=subst:}} gives Expression error: unrecognised punctuation character "{"(-8)

(a known limitation, not serious in this case)

(3)

-(-3)

-(-8)

Expression error: unrecognised punctuation character "{"