« Return to Thread: strange behaviour of compare/3

strange behaviour of compare/3

by Simon Strobl :: Rate this Message:

Reply to Author | View in Thread

Hello,

I have just been fiddling around with a predicate that did the right thing only in the vast majority of cases. Eventually, I found out that my problem was that in a sorting procedure, I sometimes compared integers to floats. It would never have occurred to me that compare(>, 1, 1.0) is true.

Does this really have to be true? Maybe there are good reasons why this should be so. But then a word of warning in the manual entry of compare/3 would be very useful.

Simon

 « Return to Thread: strange behaviour of compare/3