package main import "math" import "fmt"
func main() { var c = math.Inf(1) fmt.Printf("%x \n", int64(c)) // -8000000000000000 fmt.Printf("%x \n", int32(c)) // -80000000 fmt.Printf("%x \n", int16(c)) // 0 fmt.Printf("%x \n", int8(c)) // 0 c = math.Inf(-1) fmt.Printf("%x \n", int64(c)) // -8000000000000000 fmt.Printf("%x \n", int32(c)) // -80000000 fmt.Printf("%x \n", int16(c)) // 0 fmt.Printf("%x \n", int8(c)) // 0 c = math.NaN() fmt.Printf("%x \n", int64(c)) // -8000000000000000 fmt.Printf("%x \n", int32(c)) // -80000000 fmt.Printf("%x \n", int16(c)) // 0 fmt.Printf("%x \n", int8(c)) // 0 } -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.