Hi Valdis,
> > Is -42nd handled?
>
> I admit being totally mystified as to what situations require proper
> handling of negative ordinals
Well, from here the one after next is the 2nd, and the one before last
is the -2nd.
Regardless, the code and documentation should match, and it seems
easi
On Mon, 08 Jul 2019 17:25:42 +0100, Ralph Corderoy said:
> Is -42nd handled?
I admit being totally mystified as to what situations require proper handling
of negative ordinals
pgpM4SES7TBLk.pgp
Description: PGP signature
--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
>Is -42nd handled?
You know where the source code is, Ralph. Have at it.
--Ken
--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Hi,
Is -42nd handled? IIRC we demand C99 so we know rounding is towards
zero. But C's remainder operator, ‘%’, returns the sign of the
dividend, unlike modulo. And then there's two's complement so INT_MIN
can't be made positive.
$ for a in ' -' ' '; do
> for b in ' -' ' '; do
>
> Geez, you could have just SAID that
Now where would be the fun in that. :-)
--
Cheers, Ralph.
--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
>The point is, that if you're going to add this, you should do it
>correctly, not just any random code that looks close.
Geez, you could have just SAID that (ok, fine, you DID say that, but ...
oh, never mind). I missed that part in your examples.
Anyway, fixed!
--Ken
--
nmh-workers
https://l
Ken, Ralph is being overly subtle (or perhaps I could use another word...)
The point is, that if you're going to add this, you should do it
correctly, not just any random code that looks close.
kre
ps: Hint: 11st is not correct.
--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-wor
Hi Ken,
> > Were you paying attention to kre's sh and my sed? :-)
>
> I mean ... yeah? Steal from the best, and all that! I had a few free
> minutes, I thought, "Oh, huh, nmh SHOULD have a function to output the
> ordinal string for dates and such", and I though it should be pretty
> easy and i
>Were you paying attention to kre's sh and my sed? :-)
I mean ... yeah? Steal from the best, and all that! I had a few free
minutes, I thought, "Oh, huh, nmh SHOULD have a function to output
the ordinal string for dates and such", and I though it should be
pretty easy and it was.
--Ken
--
nm
Hi Ken,
> > This is true. To correct that, I note mh-format(5) too has no
> > function to produce the ordinal suffix. :-)
>
> Fixed.
Impressively quick work.
+ int digit = value % 10;
+ const char *suffix;
+
+ switch (digit) {
+
>This is true. To correct that, I note mh-format(5) too has no function
>to produce the ordinal suffix. :-)
Fixed.
--Ken
--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Hi kre,
> D=$(date +%d)
> case "$D" in
> [023]1) ORD=st;;
> [02]2) ORD=nd;;
> [02]3) ORD=rd;;
> *) ORD=th;;
> esac
> case "$D" in
> 0*) SP=;;
> *) SP=' ';;
> esac
I ended up with
$ cat ~/bin/ordsuff
#! /bin
Date:Mon, 08 Jul 2019 11:37:10 +0100
From:Ralph Corderoy
Message-ID: <20190708103710.86f3121...@orac.inputplus.co.uk>
| I had a need today to have date(1) produce 8th for today
Yes, strftime() has no ordinals, and (as best I understand it) locales
don't either. T
Hi kre,
> LC_TIME says how time (of day) is represented (d/m/y m/d/y, 12 or 24
> hour, etc)
I had a need today to have date(1) produce ‘8th’ for today and find its
interpreted sequences don't support the
https://en.wikipedia.org/wiki/Ordinal_indicator, but then neither does
POSIX's LC_TIME, it se
14 matches
Mail list logo