Module:Utils/doc: Difference between revisions
Jump to navigation
Jump to search
m nowiki |
m Update intro |
||
| Line 1: | Line 1: | ||
This module provides several mathematical functions which are likely to be used frequently on the Xenharmonic Wiki. | This module provides several mathematical functions which are likely to be used frequently on the Xenharmonic Wiki. | ||
Namely, the functions in | Namely, the functions in this module can be called from other modules using <code>require('Module:Utils')</code> and the <code>_</code>-prefixed functions. | ||
== Functions == | == Functions == | ||
Revision as of 06:16, 19 August 2022
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 using require('Module:Utils') and the _-prefixed functions.
Functions
eval_num_arg(input, def_value)checks ifinputis a number; on error, usedef_value. This function is designed to be used by other modules only; it cannot be called with{{#invoke:}}.log(x, b)returns the logarithm basebofx. Parameterbdefaults to base 2 (octave) if it is omitted.round(x, prec)returnsxrounded to a precision ofprecdecimal places. Parameterprecdefaults to 3 if it is omitted.