AltME: REBOL3

Messages

DideC
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
>> same? 0.1 + 0.1 + 0.1 3
== false
>> same? 0.49999999999999994 0.5
== true
Typo:
>>  same? 0.1 + 0.1 + 0.1 0.3
== true
Ladislav
Hi, I corrected the AE? function at https://github.com/rebol/rebol-issues/issues/2259 (there were some bugs) and improved comments.
PeterWood
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?
Ladislav
Note: currently, the two's complement signed integer representation is already tested by the core-tests, otherwise it is not enforced.

Last message posted 164 weeks ago.