RE: [go-nuts] Assigning +Inf to a float32 ..

2016-09-11 Thread John Souvestre
Ignore. math.NaN() is there! J John John Souvestre - New Orleans LA From: John Souvestre [mailto:j...@souvestre.com] Sent: 2016 September 11, Sun 02:39 To: 'golang-nuts' Subject: RE: [go-nuts] Assigning +Inf to a float32 .. This does beg the question: Why is there no math.NaN

RE: [go-nuts] Assigning +Inf to a float32 ..

2016-09-11 Thread John Souvestre
: Re: [go-nuts] Assigning +Inf to a float32 .. https://play.golang.org/p/RthMnILvkP func main() { inf := float32(math.Inf(+1)) fmt.Println(inf) } -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To u

Re: [go-nuts] Assigning +Inf to a float32 ..

2016-09-11 Thread Dave Cheney
https://play.golang.org/p/RthMnILvkP func main() { inf := float32(math.Inf(+1)) fmt.Println(inf) } On Sunday, 11 September 2016 15:58:04 UTC+10, bradfitz wrote: > > Not beautiful, but... > > https://play.golang.org/p/WWEEJN8LcF > > func main() { > i32 := math.Float32frombits(0x7F80) >

[go-nuts] Assigning +Inf to a float32 ..

2016-09-10 Thread xiiophen
ok I want to assign +Inf as a float32. Currently I work around like this : package main import ( "fmt" ) func main() { var a,b,c float32 a=1 b=0 //c=float32(1.0)/float32(0.0) //can't do it //c=+Inf //doesn't work - not a keyword c=a/b //kludge fmt.Println (a,b,c) } Couldn't find a way to do