![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Algorithm In Pseudocode | delsega | UNIX for Advanced & Expert Users | 1 | 03-10-2008 11:10 AM |
| algorithm | filthymonk | Shell Programming and Scripting | 5 | 07-20-2007 04:13 AM |
| Help in Search Algorithm | bourne | SUN Solaris | 1 | 10-24-2005 02:33 PM |
| FTP's algorithm | toughguy2handle | High Level Programming | 1 | 09-23-2005 03:52 PM |
| Feedback algorithm | messier79 | High Level Programming | 0 | 03-17-2004 08:42 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Algorithm problem
Looking for an algorithm to compute the number of days between two given dates I came across a professor's C program located here: http://cr.yp.to/2001-275/struct1.c
I was wondering if anyone could tell me where the value 678882 in the line int d = dateday - 678882; comes from and also the line d += (306 * m + 5) / 10; where these numbers come from and their purpose. Thanks. |
|
||||
|
The code is doing civil date to Julian date conversion, then subtracting. Julian date algorithms are, um, interesting. The big numbers relate to the epoch used for the calculation vs the data range expected in the civil calendar. I don't know where his particular numbers came from.
See: http://scienceworld.wolfram.com/astr...ulianDate.html |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|