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 t
Not beautiful, but...
https://play.golang.org/p/WWEEJN8LcF
func main() {
i32 := math.Float32frombits(0x7F80)
fmt.Printf("%T = %v", i32, i32)
}
// float32 = +Inf
On Sat, Sep 10, 2016 at 6:55 PM, wrote:
> ok I want to assign +Inf as a float32.
>
> Currently I work around like this :
>
> p
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)
> fmt.Pri
: 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
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 n