From mboxrd@z Thu Jan 1 00:00:00 1970 From: Laurent Vivier Date: Thu, 03 Mar 2016 13:02:01 +0000 Subject: Re: [kvm-unit-tests PATCH] powerpc: Add tests for RTAS Message-Id: <56D835C9.5060506@redhat.com> List-Id: References: <1457008099-29944-1-git-send-email-lvivier@redhat.com> <56D831E5.2030604@redhat.com> In-Reply-To: <56D831E5.2030604@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Paolo Bonzini , kvm@vger.kernel.org, kvm-ppc@vger.kernel.org Cc: drjones@redhat.com, thuth@redhat.com, dgibson@redhat.com On 03/03/2016 13:45, Paolo Bonzini wrote: > > > On 03/03/2016 13:28, Laurent Vivier wrote: >> + >> +#define DAYS(y,m,d) (365UL * (y) + ((y) / 4) - ((y) / 100) + ((y) / 400) + \ >> + 367UL * (m) / 12 + \ > > Out of curiosity, where did you take this from? I knew the variant with > 2447/80 instead of 367/12, but they give the same result, as checked > with bc: Some ideas from: http://www.cantab.net/users/michael.behrend/algorithms/easter/pages/main.html 30*m + (7*(m+1) / 12) reduced into (360m + 7m + 7)/12 -> 367m/12 Laurent > $ bc > for (n=1;n<;n++)2447*n/80-367*n/12; > 0 > 0 > 0 > 0 > 0 > 0 > 0 > 0 > 0 > 0 > 0 > 0 > > Paolo > >> + (d)) >> +