[WP 34S] Julian day number conversion bug - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: Not HP Calculators (/forum-7.html) +--- Forum: Not quite HP Calculators - but related (/forum-8.html) +--- Thread: [WP 34S] Julian day number conversion bug (/thread-1904.html) [WP 34S] Julian day number conversion bug - Damien - 08-02-2014 03:53 PM Hi everyone, My prefs are: SETEUR but with RDX. (i have a 34S version 3.3T3677) When i try: 0 J->D the result is monday -1.014712 (monday january the first 4713 BC). It's OK ! But when i try: -1.014712 D->J the result should be 0 ! Not 3442082 ! 3442082 correspond to 1.014712. The sign seems to be ignored. cheers Damien. RE: [WP 34S] Julian day number conversion bug - walter b - 08-02-2014 07:13 PM Julian day numbers are Pauli's pet children d:-) RE: [WP 34S] Julian day number conversion bug - Dieter - 08-02-2014 10:16 PM (08-02-2014 03:53 PM)Damien Wrote:  But when i try: -1.014712 D->J the result should be 0 ! Not 3442082 ! 3442082 correspond to 1.014712. The sign seems to be ignored. The problem may be caused by the DATE→ command that splits the input (here DD.MMYYYY) into three separate components. Negative values generally seem to return a positive year: –1.014712 DATE→ returns 1, 1 and 4712 on the stack. Dieter RE: [WP 34S] Julian day number conversion bug - Paul Dale - 08-03-2014 12:14 AM I seem to remember that we decided to not support negative dates because the calendar is pretty weird around and before year zero. It was put in place only a little prior in 45BC. The Julian calendar doesn't have a year zero but astronomers do. The presence of leap years pre-zero are also somewhat ad-hoc. Currently, conversions of dates take the absolute value of their argument. This is probably the wrong thing to do but it seemed like the best option at the time. What is best here? There is no correct which would be my usual aim. I could limit JDN conversions to after the year zero which seems suboptimal or I could lie about the Julian calendar's reach back in time and ignore the strange stuff. - Pauli RE: [WP 34S] Julian day number conversion bug - Paul Dale - 08-03-2014 12:20 AM From the manual: Quote:Dates before the year 8 may be indicated differently to what they really were due to the inconsistent application of the leap year rule before this. We count on your understanding and hope this shortcoming will not affect too many calculations. - Pauli RE: [WP 34S] Julian day number conversion bug - walter b - 08-03-2014 05:32 AM (08-03-2014 12:20 AM)Paul Dale Wrote:  From the manual: Quote:Dates before the year 8 may be indicated differently to what they really were due to the inconsistent application of the leap year rule before this. We count on your understanding and hope this shortcoming will not affect too many calculations. Correct. I just didn't remember that. d:-) RE: [WP 34S] Julian day number conversion bug - Damien - 08-03-2014 10:48 AM Julian day numbers are a very useful artificial timeline, i would have prefer the full 'astronomic' implementation. Thank you for your clarification, i will do some programming. cheers, Damien. RE: [WP 34S] Julian day number conversion bug - Paul Dale - 08-03-2014 11:23 AM (08-03-2014 10:48 AM)Damien Wrote:  i would have prefer the full 'astronomic' implementation. Care to elucidate as to what the astronomic implementation is? I've read more than a bit and understand the usefulness of the JDN and that it differs from our calendar, however I'm not an astronomer and don't know the intricate details of the timeline. - Pauli RE: [WP 34S] Julian day number conversion bug - Damien - 08-03-2014 12:54 PM I am sorry not to have been clear enough, Quote:i would have prefer the full 'astronomic' implementation what i wanted to say is that astronomers need to count years logically, taking the year before 1 AD as 0, and the year before that as -1, it becomes easier to make calculations. If you want to compare past events from different calendars, the easiest way is to convert the date of each event into julian day number, then go back and forth to year count for easier comparaison. like 880 BC. = JD 1400000 (more or less). For this purpose, i think it would be interesting to have JDN conversion working for negative date. Cheers, Damien. RE: [WP 34S] Julian day number conversion bug - walter b - 08-03-2014 03:20 PM (08-03-2014 12:54 PM)Damien Wrote:  If you want to compare past events from different calendars, the easiest way is to convert the date of each event into julian day number, then go back and forth to year count for easier comparaison. Maybe I'm too dumb for this, but how do you plan to enter such events? Let's take the date of the battle of Marathon, for example. d:-? RE: [WP 34S] Julian day number conversion bug - Damien - 08-03-2014 06:07 PM Hi Walter, Quote:Maybe I'm too dumb for this, but how do you plan to enter such events? Let's take the date of the battle of Marathon, for example. i am sure you are not, Imagine you are an historian (or just keen on history) and you have an old persian calendar which gives you a chronology of the same battle but from the persian Empire point of view; it would be interesting to compare dates. if you know the inner mechanism of that old primitif persian calendar, it can be converted to JDN, because JDN is only a count of elapsed days starting from 0 (1/01/4713 BC) to now. History books dates the Battle of Marathon to august or september 490 BC (julian calendar). Here the JDN conversion is easy to do. Then it becomes easy to compare dates which use the same unit of measurement ! Cheers, Damien. PS: Sorry for my english, but it is the second longest post I wrote this year ! I know i need to practice...) !!