This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: math constants


On 02/04/2013 01:47 PM, Paolo Carlini wrote:
Hi,

On 02/04/2013 06:25 PM, Ulrich Drepper wrote:
On Mon, Feb 4, 2013 at 12:16 PM, Paolo Carlini <paolo.carlini@oracle.com> wrote:
The general idea makes *a lot* of sense of course. Before adding too much
code, however, I think we should double check whether something is going on
already in terms of a facility planned for TR2 or even existing already in
eg, Boost.
boost has something incredibly ugly.  They use template functions to
return the values and some ugly way to allow initialization of data
types other than float/double/long double using strings.
Ok...
I think constexpr are much more in line with C++11 and going forward
and the math_constants class follows the numeric_limits approach.  If
you could look through the meeting notes that'd be appreciated. I
wouldn't even know where to start.
Agreed. I'll check and also ask people at the next Meeting. In the meanwhile we can certainly add something which we think makes sense in terms of interfaces, uglified for now, to be safe.

Paolo.


I just remembered I found it necessary to add math constants for the old TR1 math functions.


If you look at include/tr1/special_function_util.h I had a floating_point_constant template in analogy to the standard integral_constant.
Then I added a bunch of math constants. So we have some prior art in this.


I would be in strong support of a fully standard solution along these lines.

Ed


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]