@jj
comparing qwords to qwords or real8 to real8 is easy and straightforeward, the trouble begins, when you want to compare mixed types.
@all:
Having run some tests all i can say by now is: Comparisons between a signed qword and a real10 always yield a correct result. A signed qword has a maximum of 19 decimal places, which are fully covered by a real10. An unsigned qword needs a maximum of 20 decimal places, which doesn´t fit into the FPU.
And as a rule of thumb it is safe to compare word sized integers (signed and unsigned) to real4, dword sized integers (signed and unsigned) to real8. When trying to compare e.g a dword to a real4, you must consider that a dword with more than 6 decimal places cannot be exactly represented by a real4. Of course you will always get a result, but it might not be, what you expect.
It seems i must accept an inaccuracy in the last decimal place, when an unsigned qword reaches and exceeds 2^63. This is for comparing it to a real10, i must accept even more inaccuracy for real8 and real4.
I´m going to try, what HSE proposes ...
JK