Re: [kvm-unit-tests PATCH] powerpc: Add tests for RTAS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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))
>> +
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux