(34S) - Sunrise/Sunset
|
02-13-2015, 02:19 PM
Post: #15
|
|||
|
|||
RE: WP 34S - Sunrise/Sunset
(02-13-2015 06:52 AM)Dieter Wrote: May I suggest a few more improvements? Of course, I have already made a lot of improvements based on your methods. (02-13-2015 06:52 AM)Dieter Wrote: The program in its current version uses lots of registers. Some for constants that are better entered directly (e.g. 90, 15, 18, 360), cf. my version. Some more registers are used for intermediate results that are not recalled later. Without these, the register count could drop to ~10 (instead of >20 now). I went through and eliminated several stored constants by using inline integers. I now use 16 registers. 360 is outside the range of inline integers, but its entry could still be shortened by one step via #036 SDL 001. I still store it the first time it is entered because it is used two more times, so storage and later recall saves a step. 90 and 15 can of course be entered via inline integer, but I store it because when it is used later, RCL arithmetic is used to shave some steps. (In my usage, it saves one step in each case.) But it may be possible to eliminate others by re-use or using the stack, I will look into that. (02-13-2015 06:52 AM)Dieter Wrote: Regarding the DST code: my suggestion implements the rules within the EU since 1996 (in earlier years different rules applied, e.g. DST ending in September). This is fine for EU citizens, but users in different places of the world should implement their own DST routine. For "worldwide use" I'd suggest removing the DST part and simply have the user set Flag A if he wants to see DST results (+1 hour). Alternatively the program could always return UTC results. Which would please our UK members and annoy those in Australia/NZ. #-) Your DST routine was easy to modify (assuming I did it correctly) to implement the DST rules followed in the US (and Canada, I believe, that being that DST starts 2nd Sunday in March, ends 1st Sunday in November). I like having it automatically handled in the program, but a manual mode may be more appropriate for some users, in which case your suggestion to remove the DST code and simply set or not set Flag A is excellent. Flag A lights the big “=” annunciator in the display, so that provides a nice visual indication. (02-13-2015 06:52 AM)Dieter Wrote: Finally: like many other HPs, the 34s features direct h.ms arithmetics, so when computing the day length there is no need to convert to decimal hours, subtract and convert back to h.ms again: simply use H.MS– instead. ;-) Yet another example of my failing to utilize the full capabilities of the wp34s as I attempted to port over versions written for less capable calculators. Thanks for your review and comments. Jeff Dave - My mind is going - I can feel it. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 5 Guest(s)