From mboxrd@z Thu Jan 1 00:00:00 1970 From: Laurent Vivier Subject: Re: [kvm-unit-tests PATCH] powerpc: Add tests for RTAS Date: Thu, 3 Mar 2016 14:02:01 +0100 Message-ID: <56D835C9.5060506@redhat.com> References: <1457008099-29944-1-git-send-email-lvivier@redhat.com> <56D831E5.2030604@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: drjones@redhat.com, thuth@redhat.com, dgibson@redhat.com To: Paolo Bonzini , kvm@vger.kernel.org, kvm-ppc@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:51011 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751002AbcCCNCF (ORCPT ); Thu, 3 Mar 2016 08:02:05 -0500 In-Reply-To: <56D831E5.2030604@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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<=12;n++)2447*n/80-367*n/12; > 0 > 0 > 0 > 0 > 0 > 0 > 0 > 0 > 0 > 0 > 0 > 0 > > Paolo > >> + (d)) >> +