Boost logo

Boost :

From: David Bergman (davidb_at_[hidden])
Date: 2002-09-03 12:59:17


Hey, Herve!

Do not spoil the fun for us who want to define Date Analysis. I always
wanted to take the sine of 2 PM on a Tuesday like this one ;-)

You are right, although I hope that someone can take ideas from this
arithmetic interval library, the proposed range library and the date &
time libraries in Boost, and do something intervalizing that is not
specifically for scientific (read "analytical functions and their
domains") use.

/David

-----Original Message-----
From: boost-bounces_at_[hidden]
[mailto:boost-bounces_at_[hidden]] On Behalf Of Herve Bronnimann
Sent: Tuesday, September 03, 2002 1:07 PM
To: boost_at_[hidden]
Subject: Re: [boost] Re: Interval Library -- Using Interval for
Dates/Times

On Tue, Sep 03, 2002 at 05:55:57PM +0200, Guillaume Melquiond wrote:
> On Tue, 3 Sep 2002, Jeff Garland wrote:
> >
> > 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.

AFAICT, I think you are making the point that these free template
functions don't make a problem since they will never be instantiated.
And I agree. So as long as it does not instantiate sin(date), a program
will compile.

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

I think that Guillaume makes an even stronger point: it will compile and
execute without throwing or dumping an assertion. It will simply return
the interval [-1,1] (dummy function). What a date does with it is its
own problem :)

And since the issue is a little moot, I suggest not wasting too much
bandwith on sin(date). I find the other problems Jeff has raised to
pertain more significantly to the issue of date intervals, and should
anyone want to pursue the issue further, these could be discussed first
IMHO.

Yours,

-- 
Hervé
_______________________________________________
Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk