Using SFloat to convert an integer into an "equivalent" software float, so that it can take an attribute, is a nice extension. Thanks for sharing it. For those wondering what Roman is doing, here is the idea (I assume),
sortpolys := proc(polys,vars)
,p = polys)));
sortpolys([x^3+x, 1, x^2+x+1],x);
[1, x + x + 1, x + x]
However, I wouldn't think that there would be much speed advantage of this compared to my method 2 (where the keys are precomputed but pairs are used for the comparison) except for fairly long lists. How many monomials do you have to sort?
Is there a similar method for making any numeric quantity attributable while permitting it to be directly compared with other such numbers? SFloat can handle floats but not fractions:
Error, invalid arguments for Float constructor
I'd be reluctant to use evalf because of the possibility of round-off.