User:Arseniiv/Factorization: Difference between revisions
Jump to navigation
Jump to search
m no, bad |
m transclude doc |
||
Line 1: | Line 1: | ||
{{#replace: {{#regex: {{#regex: {{{1|1}}}|/(\d+)\s*(?:(?:\*\*{{!}}\^)\s*([-−]?\d+))?(?:\s*\*)?\s*/u|\1<sup>\2</sup> ⋅ }}|/\s⋅ $/u|}}|-|−}}<noinclude> | <includeonly>{{#replace: {{#regex: {{#regex: {{{1|1}}}|/(\d+)\s*(?:(?:\*\*{{!}}\^)\s*([-−]?\d+))?(?:\s*\*)?\s*/u|\1<sup>\2</sup> ⋅ }}|/\s⋅ $/u|}}|-|−}}</includeonly><noinclude> | ||
== How to use this template == | |||
{{/Doc}} | |||
[[Category:Templates]] | |||
</noinclude> | </noinclude> |
Revision as of 23:15, 7 November 2020
How to use this template
How to use this template
This template outputs prime factorization in a pleasant form, given a plain-text expression.
For multiplication use *
. For exponentiation use **
or ^
. You can add extra spaces around all these, just not between -
and an exponent.
One of good choices to write a readable source text is using spaces between factors and no space around exponentiation (the first two examples below).
Input | Output |
---|---|
{{Factorization|2^3 * 5 * 23^-3 * 31}} |
Lua error in Module:Utils at line 175: attempt to compare nil with number. |
{{Factorization| 2**3 * 5 * 7**-5 * 11**9 * 19**-4 }} |
Lua error in Module:Utils at line 175: attempt to compare nil with number. |
{{Factorization|3*7^-2*11*13^-1}} |
Lua error in Module:Utils at line 175: attempt to compare nil with number. |
{{Factorization}} |
22 × 3 |