Re: [go-nuts] Float multiplication bug?

2018-02-22 Thread Michael Jones
finished. Steve, this may help explain. https://play.golang.org/p/tcy1QFZb-Fp On Thu, Feb 22, 2018 at 5:35 PM, Michael Jones wrote: > https://play.golang.org/p/0XRLg6-6uPk > > On Thu, Feb 22, 2018 at 1:09 PM, andrey mirtchovski > wrote: > >> in

Re: [go-nuts] Float multiplication bug?

2018-02-22 Thread Michael Jones
https://play.golang.org/p/0XRLg6-6uPk On Thu, Feb 22, 2018 at 1:09 PM, andrey mirtchovski wrote: > in the first Printf "area" is truncated. try %.40f to see the real > value, which is more like: > > 262256.4523014638689346611499786376953125 > > plugging that in as h2 will

Re: [go-nuts] Float multiplication bug?

2018-02-22 Thread andrey mirtchovski
sorry, i just realized that i said 'area' but meant 'height' in my previous email. On Thu, Feb 22, 2018 at 2:09 PM, andrey mirtchovski wrote: > in the first Printf "area" is truncated. try %.40f to see the real > value, which is more like: > >

Re: [go-nuts] Float multiplication bug?

2018-02-22 Thread andrey mirtchovski
in the first Printf "area" is truncated. try %.40f to see the real value, which is more like: 262256.4523014638689346611499786376953125 plugging that in as h2 will result in 39709429597.0098280725069344043731689453125 (according to wolfram alpha) On Thu, Feb 22, 2018 at 1:32 PM,

[go-nuts] Float multiplication bug?

2018-02-22 Thread steve_bagwell
Hello Everyone, This looks like a Golang bug to me. What do you all think? > I have this function ... func getArea(base, side int64) float64 { > var height, fSide, area float64 > fSide = float64(side) > halfBase := float64(base) / 2.0 > height = math.Sqrt(fSide*fSide - halfBase*halfBase) >