Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Sat Aug 6 14:58:38 PDT 2016


On 8/6/2016 2:12 PM, David Nadlinger wrote:
> This is true – and precisely the reason why it is actually defined
> (ldc.attributes) as
>
> ---
> alias fastmath = AliasSeq!(llvmAttr("unsafe-fp-math", "true"),
> llvmFastMathFlag("fast"));
> ---
>
> This way, users can actually combine different optimisations in a more tasteful
> manner as appropriate for their particular application.
>
> Experience has shown that people – even those intimately familiar with FP
> semantics – expect a catch-all kitchen-sink switch for all natural optimisations
> (natural when equating FP values with real numbers). This is why the shorthand
> exists.

I didn't know that, thanks for the explanation. But the same can be done for 
pragmas, as the second argument isn't just true|false, it's an expression.


More information about the Digitalmars-d mailing list