Differences in results when using the same function in CTFE and Runtime
claptrap
clap at trap.com
Fri Aug 16 00:17:16 UTC 2024
On Thursday, 15 August 2024 at 10:25:45 UTC, Dom DiSc wrote:
> On Wednesday, 14 August 2024 at 07:54:15 UTC, claptrap wrote:
>> I agree the compiler should actually use the float precision
>> you explicitly ask for.
>
> But if you do cross compiling, that may simply be not possible
> (because the target has different hardware implementation than
> the hardware the compiler runs on).
So if have some CTFE function that doesn't a bunch of
calculations in double precision and the compiler is running on a
platform that only supports float, what happens?
> Also relying on specific inaccuracy of FP calculations is very
> bad design.
It's not relying on them, it's accounting for them.
More information about the Digitalmars-d
mailing list