Always false float comparisons

Manu via Digitalmars-d digitalmars-d at puremagic.com
Wed May 18 04:59:03 PDT 2016


On 18 May 2016 at 21:53, ixid via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> On Wednesday, 18 May 2016 at 11:38:23 UTC, Manu wrote:
>>
>> That's precisely the suggestion; that compile time execution of a
>> given type mirror the runtime, that is, matching precisions in this
>> case.
>> ...within reason; as Walter has pointed out consistently, it's very
>> difficult to be PERFECT for all the reasons he's been repeating, but
>> there's still a massive difference between the runtime executing a
>> bunch of float code, and the compile time executing it all promoted to
>> 80bits. Results will drift apart very quickly.
>
>
> What do you think can be productively done to improve the situation? I am
> beginning to think a Wiki-like structure would be better for these
> discussions where each major debater has their thoughts on a specific issue
> in a relevantly headed section so there is more clarity.

I've said so many times; I think it would be more useful if CTFE
operated on the *specified type*. That is all. That should produce
results as close as reasonably possible to the runtime.
If I want CTFE to operate at real precision (as is often the case),
float functions just take an 'isFloatingPoint!T' and users can execute
them at whatever precision they like. Most float functions already
have this form.


More information about the Digitalmars-d mailing list