
From:  Eric Hughes 
Subject:  Re: [Gnashcommit] 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 mathematicallycorrect world. If the comparisons are on numbers, and you have a metavalue that means notanumber, but the comparisons between numbers, as functions on the set "numbers union specialvalue" 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. Notanumber 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 metavalues. Overflow creates a compact representation of infinity, and underflow creates a nonHaussdorf point at 0, i.e. three topologically inseparable values, but these are still welldefined spaces.
Eric
[Prev in Thread]  Current Thread  [Next in Thread] 