On Thu, 20 May 2004, Ordak D. Coward wrote: > Ordak's 2820 year method: > bool isLeap2820ODC = ((683*year+542) % 2820) < 683; > > in comparison to: > > Birashk's 2820 year method: > bool isLeap2820Birashk = ((year % 2820) == 474) || > (((31 * ((year+2345) % 2820)) % 128) > 96);
I second that. Here is my version, in a desktop calculator friendly (and macrowize side-effect-less) way: #define is_persian_leap(y) ((((y)-474)%2820+2820)%2820*31%128<31) > The discrepancies will be in: > years that Ordak considers leap but not Birashk > 603, 731, 859, 1787, 1915, 2043, 2171, 2299, 2427, 2460, 2555, 2588, > 2683, 2716, 2811, 2844, 2939, 2972, 3067, 3100, 3133, 3195, 3228, > 3261, 3295 > > and > years that Birashk considers leap but not Ordak > 602, 730, 858, 1788, 1916, 2044, 2172, 2300, 2428, 2461, 2556, 2589, > 2684, 2717, 2812, 2845, 2940, 2973, 3068, 3101, 3134, 3196, 3229, > 3262, 3294 > > Caveat: > According to: > http://scienceworld.wolfram.com/astronomy/TropicalYear.html > The length of year is decreasing each year. According to graphs in > http://www.angelfire.com/dc2/calendrics/ > The real length of vernal equinox year (Iranian year) is increasing > each year (from 351 BC to 3175 A.D.) According to Iranian tradition, > vernal equinox should happen before noon (I think it means > astronomical noon). So, there is not much we can do with simple > algorithms other than trying to approximate the real world, and > understanding the fact that ALL calendar algorithms are only > APPROXIMATIONS. > > -- > ODC Well, so what do you suggest? Working on an approximate astronomical algorithm or go with Birashk's? --behdad behdad.org _______________________________________________ PersianComputing mailing list [EMAIL PROTECTED] http://lists.sharif.edu/mailman/listinfo/persiancomputing