Boost logo

Boost :

From: Guillaume Melquiond (gmelquio_at_[hidden])
Date: 2002-09-03 10:55:57

On Tue, 3 Sep 2002, Jeff Garland wrote:

> Here are a couple responses to other postings:
> On 2 Sep Guillaume Melquiond wrote:
> >To use intervals for dates is something I never considered, so please
> >excuse me if I miss the point. In my opinion, a date is just a number
> >(maybe in a strange base). So you can use the library with it (even if I
> >don't see the interest to use such a complex library on such a simple
> >datatype).
> I'm not sure I see the issue here. Since a date_time type (eg: date)
> should fail to compile since sin(date) is undefined. Since thes
> operations are all defined as free template functions I don't see
> a problem.

Who said that sin(interval<date>) needed sin(date) to be defined for it to
compile? It only needs the rounding policy to define two methods
cos_down(date) and cos_up(date). And the default rounding policy doesn't
trust the existence and precision of the transcendental functions so it
doesn't rely on them and provides its own dummy functions. So, yes, it
will compile.

> >And it's not because the library allow you to compute the sinus of an
> >interval that you are forced to compute it. Moreover, if you actually try
> >to compute the sinus of your date interval, you may get the constant
> >answer [-1:1] (just to say that, depending on the type, the library may
> >not even try to compute the sinus).
> I think compilation fails, see above.



Boost list run by bdawes at, gregod at, cpdaniel at, john at