From: Karel Zak <kzak@redhat.com>
To: kerolasa@gmail.com
Cc: Bernhard Voelker <mail@bernhard-voelker.de>,
util-linux <util-linux@vger.kernel.org>
Subject: Re: [PATCH 0000] pull: cal the branch four
Date: Tue, 28 May 2013 15:49:25 +0200 [thread overview]
Message-ID: <20130528134925.GC30341@x2.net.home> (raw)
In-Reply-To: <CAG27Bk19Z3GFnu5=-hvuWT9mCuZ23f5h_YpeA1q11WdgGTxt2w@mail.gmail.com>
On Sun, May 26, 2013 at 07:55:55PM +0100, Sami Kerola wrote:
> On 26 May 2013 19:23, Bernhard Voelker <mail@bernhard-voelker.de> wrote:
> > On 05/26/2013 11:14 AM, Sami Kerola wrote:
> >> The cal branch I have in my git has got fixes to issues reviewed earlier,
> >> and I hope all works. Based on that I decided to get rid of upper cal
> >> year limit, 9999, and replace it with unsigned long. I know the change
> >> does not make much practical sense, the point of the change is that where
> >> there is no need to have artificial limits to a random magic number they
> >> should not exist.
> >
> > unsigned years ... hmm, not that this would work today, but what about BC
> > years? E.g. on what weekday did Julius Caesar die (March 15th, 44 BC, [1])?
> > Maybe a future improvement (... having to make years signed again)?
> >
> > [1] http://en.wikipedia.org/wiki/Julius_Caesar
>
> Hi Berny,
>
> You are right. I'll make the year to be signed, and make error to be
> displayed, for now, if negative year is defined.
>
> BTW I tried the Tøndering's algorithm negative years and it gave odd
> and obviously wrong results. If someone who is part of this list is
> interested of mathematical puzzles making the negative year weekday
> determination to work should be interesting challenge.
If I good remember from "my previous life" than for example
PostgreSQL uses Julian calendar for unlimited datetime calculations.
See https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/datetime.c
and date2j(), j2date() and j2day() functions. Anyway, I have no clue
if the calculations are correct (in regards to reformation 1752).
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
next prev parent reply other threads:[~2013-05-28 13:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-26 9:14 [PATCH 0000] pull: cal the branch four Sami Kerola
2013-05-26 9:14 ` [PATCH 1/4] cal: use Claus Tøndering's day of the week algorithm Sami Kerola
2013-05-26 9:14 ` [PATCH 2/4] cal: remove arbitrary limit of maxium year being 9999 Sami Kerola
2013-05-26 9:14 ` [PATCH 3/4] tests: check cal works when year is far in future Sami Kerola
2013-05-26 9:14 ` [PATCH 4/4] docs: cal: stop telling year 9999 is upper limit Sami Kerola
2013-05-26 18:23 ` [PATCH 0000] pull: cal the branch four Bernhard Voelker
2013-05-26 18:55 ` Sami Kerola
2013-05-26 19:59 ` Sami Kerola
2013-05-28 13:49 ` Karel Zak [this message]
2013-05-29 16:20 ` Sami Kerola
2013-05-28 13:50 ` Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130528134925.GC30341@x2.net.home \
--to=kzak@redhat.com \
--cc=kerolasa@gmail.com \
--cc=mail@bernhard-voelker.de \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox