aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorVincent Robinson <robinsonvincent89@gmail.com>2021-04-01 15:18:58 -0700
committerGitHub <noreply@github.com>2021-04-02 00:18:58 +0200
commit3560691c0aecd89dc7f7d91ed8c4f1eaa9715eaf (patch)
tree966ad8508d97379c612e4fa8ee9822aa481e5478 /doc
parent1e4913cd76f5d31456d04a5ce23e66d5c60060de (diff)
downloadminetest-3560691c0aecd89dc7f7d91ed8c4f1eaa9715eaf.tar.gz
minetest-3560691c0aecd89dc7f7d91ed8c4f1eaa9715eaf.tar.bz2
minetest-3560691c0aecd89dc7f7d91ed8c4f1eaa9715eaf.zip
Add `math.round` and fix `vector.round` (#10803)
Diffstat (limited to 'doc')
-rw-r--r--doc/lua_api.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index d333ca58b..8a8f57eb3 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -3163,6 +3163,7 @@ For the following functions, `v`, `v1`, `v2` are vectors,
* Returns a vector, each dimension rounded down.
* `vector.round(v)`:
* Returns a vector, each dimension rounded to nearest integer.
+ * At a multiple of 0.5, rounds away from zero.
* `vector.apply(v, func)`:
* Returns a vector where the function `func` has been applied to each
component.
@@ -3237,6 +3238,8 @@ Helper functions
* If the absolute value of `x` is within the `tolerance` or `x` is NaN,
`0` is returned.
* `math.factorial(x)`: returns the factorial of `x`
+* `math.round(x)`: Returns `x` rounded to the nearest integer.
+ * At a multiple of 0.5, rounds away from zero.
* `string.split(str, separator, include_empty, max_splits, sep_is_pattern)`
* `separator`: string, default: `","`
* `include_empty`: boolean, default: `false`