This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [PATCH] C++ math constants


On Thu, 2013-02-21 at 17:14 +0000, Alec Teal wrote:
> On 21/02/13 16:32, Ulrich Drepper wrote:
> > How about the attached file as a start for <ext/math>.  I used the
> > constexpr approach (instead of function calls) and replicated the
> > constants that are available in <math.h> in Unix.
> >
> > What other constants to add?
> Pi/3

> 1/e
> 

I'm wondering, why adding constants for these if the compiler can figure
it out from e.g. "math::pi/3" (or whatever the namespace is)?

> ln(3)
> ln(10) (for base conversions)
> sqrt(3)
> sqrt(5)
> sqrt(7)

Aren't these evaluated by the compiler and converted to constants?

Cheers,
Oleg


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