It's what I though too. Same behaviour for '= and '== of course.
But it does not answer to the 'lesser-or-equal? and 'greater-or-equal? transitivity question.
PeterWood
I left an extra line in my posting :-(
What I am suggesting that it would be good for equal? to use Ladislav's transitive approximate-equal? but strict-equal? should check that the values are actually equal. So that the future behaviour would be >> equal? 0.1 + 0.1 + 0.1 0.3 == true >> strict-equal? 0.1 + 0.1 + 0.1 0.3 == false
I suppose same? could provide the actual check that the values are actually equal but it doesn't seem to in Rebol2
I see that same? works as I expected in Rebol 3: >> same? 0.49999999999999994 0.5 == false
>> same? 0.1 + 0.1 + 0.1 0.3 == false
Ladislav
Yes, Peter
PeterWood
So my thought that strict-equal? should check for the values being the same is probably not necessary.
Ladislav
examples:
>> ae? 0.49999999999999994 0.5 == true
>> ae? 0.1 + 0.1 + 0.1 0.3 == true
However, AE? is transitive, and (while only exceptionally), sometimes you get FALSE from AE? A B even when A and B differ only by one ULP. This is inevitable for a transitive relation.
(I should have said: this is inevitable for a nontrivial transitive relation)
PeterWood
That seems very reasonable.
Ladislav
At present, there is only one difference between SAME? and STRICT-EQUAL? for decimals in Rebol3. It is this one:
>> strict-equal? 0.0 -0.0 == true
>> same? 0.0 -0.0 == false
The difference is caused by the fact that 0.0 and -0.0 have different binary representations.
>> to binary! 0.0 == #{0000000000000000}
>> to binary! -0.0 == #{8000000000000000}
PeterWood
So strict-equal? is more strict in R3 than R2.
Ladislav
Yes
PeterWood
That's good.
Ladislav
Hi all, as far as I know, Rebol is considered a high-level cross-platform language. For example, in Windows and in all GCC-compiled platforms it uses two's complement signed integers. I think that to be truly cross-platform, it should use two's complement signed integers on every platform. What do others think on this?