[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master 71783e9: Add the string-numeric-lessp function
From: |
Lars Ingebrigtsen |
Subject: |
Re: master 71783e9: Add the string-numeric-lessp function |
Date: |
Sun, 21 Feb 2016 16:36:30 +1100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
Lars Ingebrigtsen <address@hidden> writes:
> There has to be a simple way to do that check... hm... I see that
> `string-to-number' uses strtoumax... Hm... perhaps I can rewrite this
> function to use that instead...
The code almost got simpler, even. `string-numeric-lessp' now reverts
to calling `string-lessp' if any of the embedded numbers overflow
size_t. I think that should be OK for any real world usages... I mean,
even that could be fixed if we want to be really picky, but I'm not sure
it's worth it.
(The fix would be: If the numerical stretches are of unequal length,
then obviously the shorter one is smaller than the longer. If they're
of equal length, then we can just compare the numerical stretches
lexicographically. So we don't really really need to convert anything
to numbers, anyway...)
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Re: master 71783e9: Add the string-numeric-lessp function, Paul Eggert, 2016/02/21
Re: master 71783e9: Add the string-numeric-lessp function, Lars Ingebrigtsen, 2016/02/21