Mercurial > octave
changeset 5859:ba0bea22167b
[project @ 2006-06-14 18:18:51 by jwe]
author | jwe |
---|---|
date | Wed, 14 Jun 2006 18:18:51 +0000 |
parents | 6bd94066d360 |
children | b645066d40ad |
files | scripts/ChangeLog scripts/time/datevec.m src/DLD-FUNCTIONS/fsolve.cc |
diffstat | 3 files changed, 10 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog Tue Jun 13 18:55:53 2006 +0000 +++ b/scripts/ChangeLog Wed Jun 14 18:18:51 2006 +0000 @@ -1,3 +1,7 @@ +2006-06-14 John W. Eaton <jwe@octave.org> + + * time/datevec.m: Attempt to account for precision of datenum format. + 2006-06-01 Quentin H. Spencer <qspencer@ieee.org> * audio/wavread.m: Fix file range error and add read support for
--- a/scripts/time/datevec.m Tue Jun 13 18:55:53 2006 +0000 +++ b/scripts/time/datevec.m Wed Jun 14 18:18:51 2006 +0000 @@ -152,8 +152,12 @@ ++y(m > 12); m(m > 12) -= 12; - ## Convert hour-minute-seconds - s = 86400 * (date - floor (date)); + ## Convert hour-minute-seconds. Attempt to account for precision of + ## datenum format. + + fracd = date - floor (date); + srnd = 10 .^ floor (log10 (365.25*y)); + s = round (86400*fracd.*srnd) ./ srnd; h = floor (s / 3600); s = s - 3600 * h; mi = floor (s / 60);