如何在 golang 中將float64值轉(zhuǎn)換為十六進(jìn)制字符串?(IEEE 754 格式)示例:-561.2863 到 0xc40c5253
1 回答

一只甜甜圈
TA貢獻(xiàn)1836條經(jīng)驗(yàn) 獲得超5個(gè)贊
fmt.Printf("%x\n", math.Float32bits(-561.2863)) fmt.Printf("%x\n", math.Float64bits(-561.2863))
游樂場:http : //play.golang.org/p/WEZEtCU1Zl。
- 1 回答
- 0 關(guān)注
- 405 瀏覽
添加回答
舉報(bào)
0/150
提交
取消