Post Reply 
How many Years Months and Days ?
03-12-2015, 02:19 PM (This post was last modified: 03-13-2015 08:32 PM by Dieter.)
Post: #9
RE: How many Years Months and Days ?
(03-11-2015 06:02 PM)ggauny@live.fr Wrote:  My old routine was running well but i did not know the trick for tests on x and 0, so it was longer.

The main advantage of this method is its elegance and simplicity, especially when the test is not followed by a GTO. In this case however it saves just one single step:

Code:
standard   improved
-------------------
 x=0?       x≠0?
 GTO 00     x>0?
 x>0?       GTO 00
 GTO 00

I also have been thinking about the simplified date calculation you suggested. The basic conclusion is: there is no definitive answer in terms of years, months and days because it all depends on how you look at it.

Let's try an example: 25.02.1950 and 23.06.1951.

You may say that it's 1 year and 3 months from 25.02.1950 to 25.05.1951, and then another 29 days from 25.05. to 23.06.1951.
So the result is 1 year, 3 months and 29 days.

But you may just as well say that between 25.02. and 23.03.1950 there are 26 days, and from there it's exactly 1 year and 3 months until 23.06.1951.
So the result is 1 year, 3 months and 26 days.

Now, if the result depends on the way you look at the problem, one day more or less doesn't matter much either.
BTW the simplified method with 30 days per month returns 1 year, 3 months and 28 days. ;-)

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How many Years Months and Days ? - Dieter - 03-12-2015 02:19 PM



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