Year(s) Month(s) Day(s) between 2 dates
|
10-27-2015, 11:25 PM
Post: #27
|
|||
|
|||
RE: Year(s) Month(s) Day(s) between 2 dates
(10-27-2015 03:06 PM)fhub Wrote: I've now entered both programs from Dieter and Didier (each in the last updated version), and there must be something wrong with the listings, because both programs don't work correctly! I deleted the program in my 34s and re-entered it according to the listing I provided. Then I tried your examples: (10-27-2015 03:06 PM)fhub Wrote: Look at the results for the 3 dates that have been mentioned in this thread: I tried all the above cases, and my program returned all results correctly: 37.0301, 72.0318 and 48.0613. And the last case did not return 14.1637 but 15.0507. So the error must be on your side. You probably entered the program incorrectly. (10-27-2015 03:06 PM)fhub Wrote: And for some special dates the results are complete nonsense: My program correctly returns 0.0100 for the first case and 0.0201 for the third. The weird answers you got must be caused by an error on your side. The second case indeed throws a Domain Error since the program tried to calculate the difference between 31 February (!) and 1 March 2015. This should get fixed. Also changing the code to the alternative method you prefer is quite simple. But again, please check the code in your 34s. You must have entered something wrong. Dieter |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)