go Ldexp()
Ldexp()方法语法
func Ldexp(frac float64, exp int) float64
go源码对Ldexp()方法的介绍:
Ldexp is the inverse of Frexp. It returns frac × 2**exp.
Special cases are:
Ldexp(±0, exp) = ±0
Ldexp(±Inf, exp) = ±Inf
Ldexp(NaN, exp) = NaN
golang标准库math.Ldexp()方法,是math.Frexp()方法的反函数,返回frac * 2**exp。除此之外,Ldexp(±0, exp) = ±0;Ldexp(±Inf, exp) = ±Inf;Ldexp(NaN, exp) = NaN。
math.Ldexp()方法实例代码
func main() {
ldexp := math.Ldexp(3, 2)
fmt.Println(ldexp)
}
运行go文件,得到输出:
12