Re: [go-nuts] Possible float64 precision problem

2022-03-10 Thread christoph...@gmail.com
Thank you for offering your help. I can now definitely confirm that there is no computation difference between Go and C in my program. There is thus no red flag to use Go in our scientific application. What a relief. The problem is that our C and Go programs don't store the values in the

Re: [go-nuts] Possible float64 precision problem

2022-03-09 Thread Pablo Caballero
Hi Christopher, what input int64 is leading to this result (difference in behavior between Go & C). Does it happen with any input? I'm asking because I'm interested in playing around with this a bit, maybe writing two trivial programs (one on each language) and comparing the machine code generated

Re: [go-nuts] Possible float64 precision problem

2022-03-09 Thread 'Dan Kortschak' via golang-nuts
On Wed, 2022-03-09 at 03:37 -0800, christoph...@gmail.com wrote: > I'm translating a scientific C program into Go that is doing some > 64bit floating point operations. > > In this process I check that the same input yields the same output. > Unfortunately they don't yield the same result, though

[go-nuts] Possible float64 precision problem

2022-03-09 Thread christoph...@gmail.com
I'm translating a scientific C program into Go that is doing some 64bit floating point operations. In this process I check that the same input yields the same output. Unfortunately they don't yield the same result, though the computation is simple. It is as follow. I receive a 64bit integer