package mainimport ("fmt")func main() {var a,b,c float32a=1b=0//c=float32(1.0)/float32(0.0) //can't do it//c=+Inf //doesn't work - not a keywordc=a/b //kludgefmt.Println (a,b,c)}
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
This does beg the question: Why is there no math.NaN() function?
John
John Souvestre - New Orleans LA
Ignore. math.NaN() is there! J
John
John Souvestre - New Orleans LA
From: John Souvestre [mailto:Jo...@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() function?
John
John Souvestre - New Orleans LA
From: golan...@googlegroups.com [mailto:golan...@googlegroups.com] On Behalf Of Dave Cheney
Sent: 2016 September 11, Sun 01:00
To: golang-nuts
Cc: xiio...@gmail.com
Subject: Re: [go-nuts] Assigning +Inf to a float32 ..
--
Actually, you would also want a way to say “which type of NaN” as there are two classes and several subclasses. I wrote code for this a while back and posted it here (IIRC).
From: <golan...@googlegroups.com> on behalf of <xiio...@gmail.com>
Date: Sunday, September 11, 2016 at 6:32 AM
To: golang-nuts <golan...@googlegroups.com>
Cc: <xiio...@gmail.com>
--
Actually, you would also want a way to say “which type of NaN” as there are two classes and several subclasses. I wrote code for this a while back and posted it here (IIRC).