Skip to content
Snippets Groups Projects
Commit 47e26527 authored by Martin Nolte's avatar Martin Nolte
Browse files

A first implementation of Mathematical Constants (for discussion)

[[Imported from SVN: r6436]]
parent 3cc6655e
No related branches found
No related tags found
No related merge requests found
......@@ -57,6 +57,7 @@ commoninclude_HEADERS = \
iteratorfacades.hh \
lcm.hh \
lru.hh \
math.hh \
matvectraits.hh \
misc.hh \
mpicollectivecommunication.hh \
......
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_MATH_HH
#define DUNE_MATH_HH
#include <cmath>
namespace Dune
{
template< class Field >
struct MathematicalConstants;
// MathematicalConstants for double
// --------------------------------
template<>
struct MathematicalConstants< double >
{
static double e () { return std::exp( 1.0 ); }
static double pi () { return std::acos( -1.0 ); }
};
// MathematicalConstants for float
// -------------------------------
template<>
struct MathematicalConstants< float >
{
static float e () { return std::exp( 1.0f ); }
static float pi () { return std::acos( -1.0f ); }
};
}
#endif // #ifndef DUNE_MATH_HH
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment