(34S) - Sunrise/Sunset
|
02-13-2015, 08:01 PM
Post: #16
|
|||
|
|||
RE: WP 34S - Sunrise/Sunset
(02-13-2015 02:19 PM)Jeff O. Wrote: I went through and eliminated several stored constants by using inline integers. I now use 16 registers. There are some intermediate values that are stored, but I cannot see that they are used later. (02-13-2015 02:19 PM)Jeff O. Wrote: 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.) That's saving steps by using more registers. ;-) If I get it right, in standard precision every register accounts for four (!) program steps. This means that the use of a separate register should save at least five steps to have a positive effect on memory usage. Otherwise using the same constant several times is the better solution. (02-13-2015 02:19 PM)Jeff O. Wrote: 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). Is this really observed by all states? Generally, implementing a different DST routine would be fine for the US and Canada, but for a international use it's not better than the EU version I posted – or any other for any region of the world. (02-13-2015 02:19 PM)Jeff O. Wrote: I like having it automatically handled in the program, but a manual mode may be more appropriate for some users Maybe the best solution is a manual mode along with some examples for writing your own localized DST routine. Here your US/Canada version as well as mine for the EU could be included. The user has to adjust the code anyway with his local timezone and location, so the idea of an individual DST routine is not too far off. All it has to do is set flag A during the DST period. Dieter |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 8 Guest(s)