Post Reply 
[WP 34S] Julian day number conversion bug
08-02-2014, 03:53 PM
Post: #1
[WP 34S] Julian day number conversion bug
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.
Find all posts by this user
Quote this message in a reply
08-02-2014, 07:13 PM
Post: #2
RE: [WP 34S] Julian day number conversion bug
Smile Julian day numbers are Pauli's pet children Wink

d:-)
Find all posts by this user
Quote this message in a reply
08-02-2014, 10:16 PM
Post: #3
RE: [WP 34S] Julian day number conversion bug
(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
Find all posts by this user
Quote this message in a reply
08-03-2014, 12:14 AM (This post was last modified: 08-03-2014 04:56 AM by Paul Dale.)
Post: #4
RE: [WP 34S] Julian day number conversion bug
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
Find all posts by this user
Quote this message in a reply
08-03-2014, 12:20 AM
Post: #5
RE: [WP 34S] Julian day number conversion bug
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
Find all posts by this user
Quote this message in a reply
08-03-2014, 05:32 AM
Post: #6
RE: [WP 34S] Julian day number conversion bug
(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:-)
Find all posts by this user
Quote this message in a reply
08-03-2014, 10:48 AM
Post: #7
RE: [WP 34S] Julian day number conversion bug
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.
Find all posts by this user
Quote this message in a reply
08-03-2014, 11:23 AM
Post: #8
RE: [WP 34S] Julian day number conversion bug
(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
Find all posts by this user
Quote this message in a reply
08-03-2014, 12:54 PM (This post was last modified: 08-03-2014 04:19 PM by Damien.)
Post: #9
RE: [WP 34S] Julian day number conversion bug
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.
Find all posts by this user
Quote this message in a reply
08-03-2014, 03:20 PM
Post: #10
RE: [WP 34S] Julian day number conversion bug
(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:-?
Find all posts by this user
Quote this message in a reply
08-03-2014, 06:07 PM (This post was last modified: 08-03-2014 07:33 PM by Damien.)
Post: #11
RE: [WP 34S] Julian day number conversion bug
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...) Smile !!
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)