Boost logo

Boost Users :

From: Jeff Garland (jeff_at_[hidden])
Date: 2005-01-22 10:51:07

On Wed, 19 Jan 2005 13:54:22 +0100, Erik Thiele wrote
> hi

Hi -- sorry to be slow on the response...anther busy week...

> 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.

Yes, you are correct we need to fix the docs.

> 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?

Yes -- the sign is reflected in all the components.

> 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 !!!!! :)

Yes, they are. We'll work on fixing the docs -- thx for the report.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at