[Lemon-devel] Math constants in C++

Alpár Jüttner alpar at cs.elte.hu
Fri Feb 1 12:59:47 CET 2008


Hi,

> static const m_pi = 	2.0 * std::acos(1.0);

Why don't you write just "static const m_pi = 0.0;"? It would be much
faster. :)

Regards,
Alpar


> These functions are surely in the C++ standard, and as I see this is the most 
> used solution.
> 
> Best, Balazs
> 
> On Friday 01 February 2008 10.56.10 Alpár Jüttner wrote:
> > Dear all,
> >
> > Can you tell me how to refer to pi (3.14...) or e (2.71...) in C++ in a
> > platform/compiler indepentend way?
> >
> > See https://lemon.cs.elte.hu/trac/ticket/20
> >
> > Is there 'standard' solution for it?
> >
> >
> > Regards,
> > Alpar
> >
> >
> > _______________________________________________
> > Lemon-devel mailing list
> > Lemon-devel at lemon.cs.elte.hu
> > http://lemon.cs.elte.hu/mailman/listinfo/lemon-devel
> 
> 
> _______________________________________________
> Lemon-devel mailing list
> Lemon-devel at lemon.cs.elte.hu
> http://lemon.cs.elte.hu/mailman/listinfo/lemon-devel




More information about the Lemon-devel mailing list