Differences in results when using the same function in CTFE and Runtime

IchorDev zxinsworld at gmail.com
Thu Aug 8 10:45:34 UTC 2024


On Thursday, 8 August 2024 at 10:31:32 UTC, Carsten Schlote wrote:
> […] assuming that the math emulation of CTFE works identical as 
> the CPU does at runtime, the outcome should be identical.

Which it probably does not. CTFE is meant to be less 
platform-dependent than runtime code, so it is interpreted rather 
than running directly on the CPU. This is why there are strict 
limitations on where CTFE can be invoked. I believe the exact 
behaviour of CTFE would be implementation-dependent though.


More information about the Digitalmars-d mailing list