December 10, 2011
On 10 December 2011 09:11, Walter Bright <walter at digitalmars.com> wrote:
>
>
> On 12/10/2011 12:01 AM, Jonathan M Davis wrote:
>>
>> Part of me thinks that NaN should be equal to NaN, but it's likely too
>> late
>> for that at this point, even if it were determined to be a good idea.
>>
>
> That issue was decided at least 25 years ago.

The IEEE decision that x != x when x is NaN was probably the wrong decision, but it's too late now. I think it has the effect that X.init is dangerous. It's one of those terrible things that nearly always works, but is broken beyond repair in the last 0.1% of cases.

Honestly, I don't get the point of X.init where by default X is uninitialized. If it's an error to access variable x, why isn't it an error to access x.init?

double x = x.init;
// is x initialized now?
December 10, 2011
On Saturday, December 10, 2011 20:37:13 Don Clugston wrote:
> On 10 December 2011 09:11, Walter Bright <walter at digitalmars.com> wrote:
> > On 12/10/2011 12:01 AM, Jonathan M Davis wrote:
> >> Part of me thinks that NaN should be equal to NaN, but it's likely too
> >> late
> >> for that at this point, even if it were determined to be a good idea.
> > 
> > That issue was decided at least 25 years ago.
> 
> The IEEE decision that x != x when x is NaN was probably the wrong decision, but it's too late now. I think it has the effect that X.init is dangerous. It's one of those terrible things that nearly always works, but is broken beyond repair in the last 0.1% of cases.
> 
> Honestly, I don't get the point of X.init where by default X is uninitialized. If it's an error to access variable x, why isn't it an error to access x.init?
> 
> double x = x.init;
> // is x initialized now?

That doesn't compile. Maybe it did before (I don't know), but when I just tried it, it failed.

- Jonathan M Davis
December 11, 2011
On Sat, 10 Dec 2011 09:01:16 +0100, Jonathan M Davis <jmdavisProg at gmx.com> wrote:

> Part of me thinks that NaN should be equal to NaN, but it's likely too
> late
> for that at this point, even if it were determined to be a good idea.

sqrt(-1.0) == 0.0/0.0? I don't think so.
1 2
Next ›   Last »