Message9157
Logged In: YES
user_id=418174
The difficulty is that as defined, < is not an order
relation, because there exist values a, b, c such that a<b,
b==c, and a==c. I believe that there also exist values
such that a<b, b<c, and a==c. Under such circumstances, it
is hard to understand how sort can work properly, whicn is
my real concern. Do you really want to warn people that
they shouldn't sort lists containing floats and longs?
Moreover, it is not terribly difficult to define the
comparisons so that == is an equivalence relation and < is
an order relation. The idea is that for any floating-point
system, there is a threshold T such that if x is a float
value >=T, converting x to long will not lose information,
and if x is a long value <=T, converting x to float will
not lose information. Therefore, instead of always
converting to long, it suffices to convert in a direction
chosen by comparing the operands to T (without conversion)
first. |
|
Date |
User |
Action |
Args |
2007-08-23 13:59:07 | admin | link | issue513866 messages |
2007-08-23 13:59:07 | admin | create | |
|