days-between-dates Solver equation for 17b
|
10-08-2018, 10:33 PM
(This post was last modified: 10-09-2018 09:33 PM by Albert Chan.)
Post: #21
|
|||
|
|||
RE: days-between-dates Solver equation for 17b
(10-08-2018 09:13 PM)Dieter Wrote: what's wrong with the shorter and less complicated standard formula for the Julian-Gregorian difference? That is good ! (above "/" meant floor division. To be safe, for month < 3, set y = y - 1) I were using 3rd century calendar match trivia. -2 days for "zero" century is simpler X = 0,1,2,3, 4,5,6,7 ... => days apart = -2,-2,-1,0, 1,1,2,3 ... = (1,1,2,3, 4,4,5,6 ...) - 3 --> Days apart = (floor(X/4) - 1) * 3 + max(X % 4, 1) For X = 21 = 5 * 4 + 1, Days apart = 4 * 3 + 1 = 13 For X = -47 = -12 * 4 + 1, Days apart = -13 * 3 + 1 = -38 Update: this is faster, Days apart = floor(0.75 X) - 2 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 5 Guest(s)