I think you'll need something like x := float(355) / float(113) - where float is either float32 or float64 depending on your preferred trade-off for accuracy vs bytes required per number.
On Monday, September 19, 2016 at 12:38:12 PM UTC-4, Mark Longtin wrote: > > Hey guys, > > I'm new to Go - through the Ivy app on IOS- so I have a newbie question. > What's the easiest way to cast or convert a rational number to its floating > point representation? > > EG, looking for something like this: > > > *float 355/113*3.14159292035 > > I could do something inelegant like > > > *floor .5+1e11* 355/113*314159292035 > > but was hoping there would be a native function for this. > > Thanks > > -- 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.