我正在尝试理解 Go Sqrt的实现,但不能完全理解该Float64bits函数发生了什么。我在下面有一些测试代码和输出。为什么 ix 的值会随着这个操作发生如此剧烈的变化?
package main
import ("math"
"fmt")
func main() {
var x float64 = 4
fmt.Printf("The value of x is: %v \n", x)
ix := math.Float64bits(x)
fmt.Printf("The value of ix is: %v \n", ix)
fmt.Printf("The type of ix is: %T \n", ix)
}
The value of x is: 4
The value of ix is: 4616189618054758400
The type of ix is: uint64
哈士奇WWW
慕的地8271018
慕尼黑的夜晚无繁华
相关分类