[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-commit] gnash ChangeLog server/as_value.cpp server/as_v...

From: Eric Hughes
Subject: Re: [Gnash-commit] gnash ChangeLog server/as_value.cpp server/as_v...
Date: Mon, 09 Jul 2007 06:21:11 -0600

At 11:24 PM 7/8/2007, zou lunkai wrote:
For swf>=5, The observed results here are:

trace(NaN == NaN);   //true
trace(NaN >= NaN);   //true
trace(NaN <= NaN);  //true
trace(NaN > NaN);    //undefined
trace(NaN < NaN);    //undefined
trace(NaN != NaN);   //false

I'm just whinging here, but all these should return "undefined" in the mathematically-correct world. If the comparisons are on numbers, and you have a meta-value that means not-a-number, but the comparisons between numbers, as functions on the set "numbers union special-value" would be partial functions defined only on pairs of numbers and be undefined if one or both elements of the pair were not a number.

This is less purely academic that it sounds. Not-a-number means "I have no information". It does not mean "I have a special new kind of number with special axiomatic properties". To say that "a=b" when both are not a number means asserting that "I have no information about a, and I have no information about b, but I know they're the same." Put this in some generic algorithm with wonky input data, and you'll get an unintended (therefore incorrect) result.

This is all FYI.  I am promoting no cause to fix AS.

Incidentally, this argument isn't the same for underflow and overflow meta-values. Overflow creates a compact representation of infinity, and underflow creates a non-Haussdorf point at 0, i.e. three topologically inseparable values, but these are still well-defined spaces.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]