math.ldexp() 函数
math.ldexp() 是 math.frexp() 的逆操作。它返回 frac x 2**exp。
函数类型签名
(exp: int, frac: float) => float
有关更多信息,请参见 Function type signatures。
参数
分数
(必需) 在运算中使用的分数。
指数
(必需) 在操作中使用的指数。
示例
返回 math.frexp 的反函数
import "math"
math.ldexp(frac: 0.5, exp: 6)// 32.0
在map中使用math.ldexp
import "math"
data
|> map(fn: (r) => ({_time: r._time, tag: r.tag, _value: math.ldexp(frac: r.frac, exp: r.exp)}))