math.copysign
code:Lua
y = textmodule.math.copysign(x, a)
モジュール
math
引数
table:_
変数 型 概要
1 x number 処理する数値
2 a number 符号を取得する数値
返り値
table:_
変数 型 概要
1 y number 処理された数値
概要
x
の絶対値に
a
の符号のついた値を取得する。
$ y=|x|×\frac{a}{|a|}