小编典典

类型:将float转换为十六进制字符串

go

如何将 float64 值转换为Golang的 十六进制字符串 ?(IEEE 754格式)

样本:-561.2863至0xc40c5253


阅读 240

收藏
2020-07-02

共1个答案

小编典典

用途math.Float(64|32)bits

fmt.Printf("%x\n", math.Float32bits(-561.2863))
fmt.Printf("%x\n", math.Float64bits(-561.2863))

游乐场:http :
//play.golang.org/p/WEZEtCU1Zl。

2020-07-02