Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Easter Sunday computation
#21
The algorithm that I have by Knuth states that it will work up to the year 99999. When I implemented it, I considered that a max of year 9999 would be enough, especially since most date handling programs only handle 4 digit years.

Even though a max of 9999 fits into an integer, I had problems with the arithmetic of the algorithm when testing with larger numbers. I can't remember whether "large" meant over 6000 or over 8000. I just used LONG and the problem went away.

Let's not forget what I mentioned about MOD not working for negative numbers. There are instances when the arithmetic produces an intermediate result that's negative.
For example, if you intend to do the following on the intermediate value called ZZZ:

RESULT = ZZZ MOD 30

If you think ZZZ could be negative, then I sugest taking the MOD as follows:

RESULT = ZZZ-30*INT(ZZZ/30)
Reply


Messages In This Thread
Easter Sunday computation - by Moneo - 06-13-2003, 03:01 AM
An unusual request. - by Agamemnus - 06-13-2003, 03:34 AM
Easter Sunday computation - by oracle - 06-13-2003, 03:40 AM
Easter Sunday computation - by Antoni Gual - 06-13-2003, 04:14 AM
Easter Sunday computation - by Agamemnus - 06-13-2003, 04:36 AM
Easter Sunday computation - by Moneo - 06-13-2003, 05:35 AM
Easter Sunday computation - by Zack - 06-13-2003, 05:40 AM
Easter Sunday computation - by Agamemnus - 06-13-2003, 05:44 AM
Easter Sunday computation - by whitetiger0990 - 06-13-2003, 06:03 AM
Easter Sunday computation - by Moneo - 06-13-2003, 06:50 AM
Easter Sunday computation - by oracle - 06-13-2003, 11:14 AM
Easter Sunday computation - by Agamemnus - 06-13-2003, 05:28 PM
Easter Sunday computation - by Moneo - 06-13-2003, 10:33 PM
Easter Sunday computation - by pr0gger - 06-13-2003, 10:38 PM
Reply to Progger re BBCode - by Moneo - 06-13-2003, 10:54 PM
Easter Sunday computation - by whitetiger0990 - 06-13-2003, 10:58 PM
Easter Sunday computation - by Mango - 06-13-2003, 11:04 PM
Reply to Agamemnus re Integers - by Moneo - 06-13-2003, 11:37 PM
Easter Sunday computation - by Agamemnus - 06-14-2003, 12:18 AM
Reply to Agamemnus re really large numbers - by Moneo - 06-14-2003, 04:16 AM
Easter Sunday computation - by Agamemnus - 06-14-2003, 04:21 AM
Code for Easter is missing a DECLARE - by Moneo - 06-15-2003, 10:10 PM
Easter Sunday computation - by oracle - 06-16-2003, 01:20 PM
Reply to Oracle re DEFINT - by Moneo - 06-16-2003, 06:50 PM
Easter Sunday computation - by Antoni Gual - 06-17-2003, 02:42 AM
Easter Sunday computation - by toonski84 - 06-17-2003, 02:52 AM
Easter Sunday computation - by oracle - 06-17-2003, 10:47 AM
Easter Sunday computation - by toonski84 - 06-17-2003, 11:02 AM
Easter Sunday computation - by Antoni Gual - 06-17-2003, 06:11 PM
Easter Sunday computation - by Moneo - 06-17-2003, 09:22 PM
More info for Antoni: - by Moneo - 06-18-2003, 06:16 AM
Easter Sunday computation - by oracle - 06-18-2003, 10:22 AM
Easter Sunday computation - by Agamemnus - 06-19-2003, 12:13 AM
Easter Sunday computation - by oracle - 06-20-2003, 02:52 AM
Reply to Oracle - by Moneo - 06-20-2003, 06:44 AM
Wrapup on this topic - by Moneo - 06-20-2003, 11:36 PM
Easter Sunday computation - by HystericPoison - 06-22-2003, 04:23 AM
Easter Sunday computation - by Ninkazu - 06-22-2003, 04:46 AM
Easter Sunday computation - by na_th_an - 06-22-2003, 04:58 AM
Easter Sunday computation - by toonski84 - 06-22-2003, 05:33 AM
Easter Sunday computation - by toonski84 - 06-22-2003, 11:19 PM
To Toonski: - by Moneo - 06-23-2003, 01:53 AM
Easter Sunday computation - by Ninkazu - 06-23-2003, 02:51 AM
Easter Sunday computation - by na_th_an - 06-23-2003, 03:42 AM
Easter Sunday computation - by Ninkazu - 06-23-2003, 04:06 AM
Easter Sunday computation - by na_th_an - 06-23-2003, 04:14 AM
Easter Sunday computation - by Ninkazu - 06-23-2003, 04:17 AM
Easter Sunday computation - by na_th_an - 06-23-2003, 04:21 AM
Easter Sunday computation - by Ninkazu - 06-23-2003, 04:38 AM
Easter Sunday computation - by toonski84 - 06-23-2003, 04:41 AM
Easter Sunday computation - by na_th_an - 06-23-2003, 05:01 AM
Easter Sunday computation - by Ninkazu - 06-23-2003, 05:18 AM
Easter Sunday computation - by Moneo - 10-20-2006, 07:33 AM
Easter Sunday computation - by Skyler - 10-21-2006, 01:41 AM
Easter Sunday computation - by Anonymous - 10-21-2006, 02:06 PM
Easter Sunday computation - by Skyler - 10-23-2006, 10:57 PM
Easter Sunday computation - by Moneo - 10-23-2006, 11:56 PM
Easter Sunday computation - by Skyler - 10-24-2006, 09:35 PM
Easter Sunday computation - by Agamemnus - 10-26-2006, 08:35 AM
Easter Sunday computation - by Moneo - 10-27-2006, 04:04 AM
Easter Sunday computation - by Agamemnus - 10-27-2006, 10:26 AM
Easter Sunday computation - by Moneo - 10-28-2006, 06:29 AM
Easter Sunday computation - by Agamemnus - 10-29-2006, 09:16 AM
Easter Sunday computation - by Moneo - 10-30-2006, 09:09 AM
Easter Sunday computation - by Agamemnus - 10-31-2006, 01:04 AM
Easter Sunday computation - by Moneo - 10-31-2006, 07:28 AM
Easter Sunday computation - by Anonymous - 10-31-2006, 11:22 AM
Easter Sunday computation - by Skyler - 10-31-2006, 10:37 PM
Easter Sunday computation - by Anonymous - 10-31-2006, 10:44 PM
Easter Sunday computation - by Moneo - 11-01-2006, 06:27 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)