|
Boost : |
From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2001-09-27 15:01:01
----- Original Message -----
From: Eric Ford <eford_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Thursday, September 27, 2001 4:34 PM
Subject: [boost] Integers and other numbers [was Re: dlw_int review]
> > * a numeric_traits<> class providing functionality beyond
> numeric_limits()
> > (and including it itself).
> > I have one, in which I added a numeric_bounds<> class.
> > numeric_bounds<> gives a consistent semantic to boundary values
> > (remember that numeric_limits::min has different semantics
> depending on
> > whether the type is integer or floating point).
>
> I wonder if a min_const static member would also be a good idea so as
> to allow things like overflow checking for compile time operations
> (e.g. checking for an overflow on lcm came up recently).
>
I think this is a good idea.
I think it is possible to add compile-time support in numeric_bounds<> and
numeric_bounds_comparison<> (see below)
* a numeric_cast<> facility (we have one already, though I tried
> before to
> > draw attention to some issues about this one)
>
> I agree with you here. I wonder if it might could be implemented a
> little more simplely than your code. But I didn't produce anything
> better. I think this is a serious issue. As long as numeric_cast<>
> is as inefficient as it presently is, it can not be considered an
> option for use in numerically intensive code. I'd encourage people to
> look at adding yor optimizations (either your or another
> implementation) to boost::numeric cast.
>
>
I'll see to do it as soon as I get enough time.
Meanwhile, I have added the files: cvt_n.h, numeric_bounds.h and
generic_math.h to the "standard_functions" directory you've created.
They are there for reference only!
Perhaps we can get some others to look at 'cvt_n.h' and 'numeric_bounds.h'
(hint, hint).
The file generic_math is not intended to compete with your
'standard_fucntions.hpp' header. I've uploaded only to give a view of the
*other* functions and stuff I have found useful for generic numeric code.
I will comment on your 'standard functions' as soon as I finished reviewing
it.
Fernando Cacciola
Sierra s.r.l.
fcacciola_at_[hidden]
www.gosierra.com
E
>
>
> Info: http://www.boost.org Unsubscribe:
<mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk