|
Boost Users : |
From: Erik Thiele (erik_at_[hidden])
Date: 2005-01-19 07:54:22
hi
the docs of time_duration say that minutes() returns 0..59 and seconds() return 0..59. this is not true,
the correct answer is, minutes() returns -59..+59 and seconds() also.
the handling of negative durations is not fully documented. i.e. is it true that the sign of
hours(),minutes() and seconds() is always equal to each others sign?
x=time_duration(anything...);
y=x.invert_sign();
is the following true for all values of x:
abs(x.hours()) == abs(y.hours())
abs(x.minutes()) == abs(y.minutes())
abs(x.seconds()) == abs(y.seconde())
but whatever way you document it, it should somehow be documented.
to continue on my work i now make the assumption that in the following
assertions are true for all values of x:
if (x.is_negative()) x = x.invert_sign();
assert(x.hours()>=0);
assert(0<=x.minutes()<=59);
assert(0<=x.seconds()<=59);
i hope this assertions are correct for all values of x !!!!! :)
cya!
erik
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net