Differences in results when using the same function in CTFE and Runtime
Carsten Schlote
carsten.schlote at gmx.net
Thu Aug 15 09:13:31 UTC 2024
On Tuesday, 13 August 2024 at 07:56:34 UTC, Abdulhaq wrote:
> One little piece of anecdata, when working with python I saw
> differing results in the 17th d.p. when running the exact same
> calculation in the same python session. The reason turned out
> to be which registers were being used each time, which could
> vary. This is not considered to be a bug.
I would consider it a bug.
Running the same piece of code multiple times with exactly the
same parameters should result into the exactly same results.
But once I also expected that CTFE and real execution of some
code should always yield the same results. This assumption is
wrong as I learned recently. But using 'real' as type usually
leads to the same result.
All the other issues with floats of any size are some separate
topic.
More information about the Digitalmars-d
mailing list