144.96
package main
import "fmt"
func main() {
var x float32 = 144.96
var y float64 = 144.96
fmt.Print(float64(x) > y, x > float32(y))
// Output: true false
}
0.1
package main
import "fmt"
func main() {
var x float32 = 0.1 // 0.100000001490116119384765625
var y float64 = 0.1 // 0.1000000000000000055511151231257827021181583404541015625
fmt.Print(float64(x) == y)
// Output: false
}
NaN
package main
import "fmt"
func main() {
var a float32 = 1
var x float32 = .0 / (a - 1) // NaN
fmt.Print(x == x)
// Output: false
}