Page 1 of 1
Date displayed weirdly with negative JD values for time.
Posted: 18.11.2007, 22:02
by Vincent
I've already posted a report about this bug on the
Sourceforge tracker, but I'm not sure anybody else has been able to reproduce it so far. That's why I'm posting a bug report here as well...
When time (in Julian days) reaches either negative values (~ year -4700) or positive values that are > INT_MAX (~ year 5 800 000), i.e., the maximum value for an integer, the date in the upper right corner gets buggy:
The following patch fixes the bug on my system:
http://vincent.gian.club.fr/celestia/observer.cpp.patch
It fixes some max/min values for simulation time:
- minimum value is 0 Julian Day.
- maximum value is INT_MAX Julian days.
With this patch,
Time can go neither below the Minimum limit nor over the Maximum limit.
Posted: 18.11.2007, 22:07
by selden
Vincent, I suspect some people would be upset with those limits. The Julian date needs to be able to go to large negative values in order to display the various paleological Addons.
Posted: 18.11.2007, 22:11
by Vincent
selden wrote:Vincent, I suspect some people would be upset with those limits. The Julian date needs to be able to go to large negative values in order to display the various paleological Addons.
Selden,
Of course, I agree...
But can you go below 0 Julian day on your system without getting a buggy date ?
I also suspect that these paleological addons/scripts don't use the real paleological times in their Beginning/Ending definitions...
Posted: 18.11.2007, 22:13
by Cham
I confirm the bug, as described by Vincent. Accelerating time by a large factor brings me to some impossible date in the future, something like month 216, day 214748, at year 5874877, etc.
Vincen't patch is working perfectly, stopping everything at a maximum date in the future (around year 5 800 000) or at a min date in the past (around year -4700).
I also suggest to define the min/max dates as some round and simple dates, so any user could learn easily what they are : bounded limits of time. I suggest using midnight of 31 december, year 4 999 999 in the future (or something like this). This way, it would be consistent on ALL systems, and easy to interpret.
It could be great to have a symetrical min date in the past, relative to 2000 as the "middle" (or maybe year 1 AD ?). Something like year -5 000 000 as a limit in the past.
Posted: 18.11.2007, 22:27
by selden
Vincent,
While time limits are reasonable to prevent wrap-around, it would be best to actually fix the incorrect date representation instead of avoiding it. Paleological Addons do need to be able to specify dates for the major geologic ages.
Posted: 18.11.2007, 22:48
by Vincent
Selden,
Finding a solid fix that would allow displaying dates correctly on a large time scale would be great, indeed!
In the meantime, we only have two alternatives, though:
1) Displaying buggy dates for the geologic ages;
2) Fixing some limit values between which the date is displayed correctly.
I'm personnaly for 2).
Posted: 18.11.2007, 22:49
by chris
Vincent wrote:Selden,
Finding a solid fix that would allow displaying dates correctly on a large time scale would be great, indeed!
In the meantime, we only have two alternatives, though:
1) Displaying buggy dates for the geologic ages;
2) Fixing some limit values between which the date is displayed correctly.
I'm personnaly for 2).
While I believe that we should set some reasonable limits for time, fixing at Julian date 0 is too restrictive. I don't think it should be that tough to find a workaround for the problem with negative dates.
--Chris
Posted: 18.11.2007, 22:57
by Vincent
chris wrote:I don't think it should be that tough to find a workaround for the problem with negative dates.
Good to hear that...
I personnaly have some clues, but haven't succeeded yet. I'll give it a second chance...