Module:Utils/doc: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
Ganaram inukshuk (talk | contribs)
add descriptions for other functions
Ganaram inukshuk (talk | contribs)
mNo edit summary
Line 22: Line 22:
| desc_prime_factorization_raw = Returns a table encoding the prime factorization of <code>n</code>.
| desc_prime_factorization_raw = Returns a table encoding the prime factorization of <code>n</code>.
| desc_signum = Returns 1 for positive numbers, −1 for negative ones, and 0 for zero and non-integer inputs.
| desc_signum = Returns 1 for positive numbers, −1 for negative ones, and 0 for zero and non-integer inputs.
| desc_next_young_diagram = Returns the next Young diagram of the same size; the first one is <code>[N]</code>, the last one is <code>[1, 1, …, 1]</code>. After the last one, <code>nil</code> is returned. The input table is modified.}}
| desc_next_young_diagram = Returns the next Young diagram of the same size; the first one is <code>[N]</code>, the last one is <code>[1, 1, …, 1]</code>. After the last one, <code>nil</code> is returned. The input table is modified.
| desc_log2 = Returns the base-2 logarithm of <code>x</code>.
| desc_log2 = Returns the base-2 logarithm of <code>x</code>.
| desc__log = Lua-only implementation of <code>log</code>.
| desc__log = Lua-only implementation of <code>log</code>.

Revision as of 04:27, 25 November 2025

{{Documentation|

This module primarily serves as a library for other modules and has no corresponding template.

This module provides several mathematical functions which are likely to be used frequently on the Xenharmonic Wiki.

Namely, the functions in this module can be called from other modules by using require("Module:Utils") and calling the desired functions.

For pairs of functions with names that differ by a single leading underscore (for example, gcd and _gcd), the function with an underscore is meant to be called by other modules, and the function without an underscore can be used with #invoke.

To see introspection summary, see this module's main page.