On 04/18/2012 10:13 AM, Jonathan M Davis wrote:
> On Wednesday, April 18, 2012 19:04:12 SomeDude wrote:
>> On Wednesday, 18 April 2012 at 16:36:39 UTC, bearophile wrote:
>>> Ali:
>>>> That a thousandth time I have made that mistake and still have
>>>> not learned. :( Yes, .nan may not be compared with any other
>>>> value, including .nan.
>>>
>>> Today I'll present an enhancement request to remove this
>>> problem from D.
>>>
>>> Hugs,
>>> bearophile
>>
>> I don't see how this could be enhanced.
>
> It's by design. An enhancement request is a waste of time. Comparisons with > NaN _always_ return false regardless of what they're compared against - even
> NaN. It's not going to change.
>
> - Jonathan M Davis

It shouldn't be a problem to detect comparisons against literal .nan values. The compiler can warn with "comparison is always false".

Ali

Reply via email to