lsort -integer does not like 64-bit ints
Open3572727fffffffffffffffffffffffffffffffffCreated 14 years agoUpdated 14 years ago
Descriptionplain2012-09-28 11:24:11
% lsort -integer {0x1ffffffff 3 4}
integer value too large to represent
An old (2000) bug 218988 exists for this but is marked fixed and closed.
Happens on 8.6b3 and 8.5.11.
pspjuthplain2012-09-28 19:44:33
Note that bug 218988 was about handling 64 bit integers on 64 bit compiles. I do agree that lsort -integer should handle bignums transparently.
dkfplain2012-09-28 19:56:59
Agreed as well; IIRC, we're currently assuming that they fit in a 'long' and that's wrong these days (and this was probably just an oversight when bignum support was added).
dkf Ticket [3572727fff]: 1 change
[History diff]2012-09-28 19:57:19
dgpplain2012-09-28 22:18:48
data_type - 360894 This is not a bug but a feature request.
dgpplain2012-09-28 22:25:32
The compatibility wrinkle that must be ironed out is this:
% lsort -integer {0xffffffffffffffff 1}
0xffffffffffffffff 1
Or, if you're on a 32-bit system, you may see it with
the value 0xffffffff.
Changing to unlimited integer support will have the advantage
of platform independence. The disadvantage will be to any non-portable
scripts relying on the ability to use hex of known size to specifiy negative
numbers.
dgpplain2012-09-28 22:28:19
And by the way, these were not matter of oversight. I pleaded for engagement on completing the job before 8.5 went final. See TIP 297. And no one was interested.
Log in (anonymous is fine) to add a comment.