Re: [go-nuts] Re: int16 and float64 Multiplication

2017-02-19 Thread 'simon place' via golang-nuts
if using fixed precision then don't use floats, just use int's with a fixed multiplier. -- 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...@g

Re: [go-nuts] Re: int16 and float64 Multiplication

2017-02-19 Thread Michael Jones
good. On Sat, Feb 18, 2017 at 11:08 PM, wrote: > After some testing I just decided to instead round the numbers to 2 > decimals instead. Thank you for the heads up though. > > On Sunday, February 19, 2017 at 5:42:15 PM UTC+11, Michael Jones wrote: >> >> This feels unlikely. >> >> You might want

Re: [go-nuts] Re: int16 and float64 Multiplication

2017-02-18 Thread ngjunyen
After some testing I just decided to instead round the numbers to 2 decimals instead. Thank you for the heads up though. On Sunday, February 19, 2017 at 5:42:15 PM UTC+11, Michael Jones wrote: > > This feels unlikely. > > You might want to verify that the calculation matches your expectations >

Re: [go-nuts] Re: int16 and float64 Multiplication

2017-02-18 Thread Michael Jones
This feels unlikely. You might want to verify that the calculation matches your expectations exactly at many values. Ian's representation argument applies at every word size it may be that you just hit a "lucky" happenstance. On Sat, Feb 18, 2017 at 11:59 PM wrote: > Thank you for your help. I

[go-nuts] Re: int16 and float64 Multiplication

2017-02-18 Thread ngjunyen
Thank you for your help. I managed to get the result I needed by using 32 bit floats. On Sunday, February 19, 2017 at 3:36:06 PM UTC+11, ngju...@gmail.com wrote: > > I am trying to multiply an int16 and float64 in Golang 1.8 but the result > it returns is incorrect. I need this number to be exac