Mercurial > hg > octave-nkf
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 +++ b/scripts/ChangeLog @@ -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 +++ b/scripts/time/datevec.m @@ -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);