math.trunc
code:Lua
y = textmodule.math.trunc(x)
モジュール
math
引数
table:_
変数 型 概要
1 x number 処理する数値
返り値
table:_
変数 型 概要
1 y number 処理された数値
概要
xをゼロ方向へ丸める。
例
code:lua
require("textmodule")
y1 = textmodule.math.trunc(2.1)
debug_print(y1) -- 2
y2 = textmodule.math.trunc(-2.1)
debug_print(y2) -- -2
y3 = textmodule.math.trunc(-3.9)
debug_print(y3) -- -3