Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!18g2000prd.googlegroups.com!not-for-mail
From: Le Fou Volant <alexaguillaume@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: addtodate irreversible behavior
Date: Tue, 17 May 2011 16:50:44 -0700 (PDT)
Organization: http://groups.google.com
Lines: 16
Message-ID: <023d0963-bd0a-47b5-9be7-ed5019be29b2@18g2000prd.googlegroups.com>
NNTP-Posting-Host: 137.78.59.23
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: posting.google.com 1305676247 13105 127.0.0.1 (17 May 2011 23:50:47 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 17 May 2011 23:50:47 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: 18g2000prd.googlegroups.com; posting-host=137.78.59.23; posting-account=y8C3kgoAAAB-A79Emmd_8mkSw0SKKxVs
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0.1)
 Gecko/20100101 Firefox/4.0.1,gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:727369

Hello,

I am leaning toward saying the addtodate does not work,
but maybe I am doing something wrong:

t0 = datenum('01-Jan-2000', 'dd-mmm-yyyy');
addtodate( addtodate(t0, 0, 'day'), -t0, 'day')

gives 2!!!
It should be zero.

I observe this behavior for any number, i.e. not just when
I add 0.

Does anyone know how to coerce addtodate to behave
properly?