1#ifndef _RHEOLEF_FLOAT_H
2#define _RHEOLEF_FLOAT_H
59#include "rheolef/config.h"
107#include "rheolef/numeric_flags.h"
112#if defined(_RHEOLEF_HAVE_FLOAT128)
113#include <boost/multiprecision/float128.hpp>
115using boost::multiprecision::float128;
116using namespace boost::multiprecision;
117static inline float128 sqr (
const float128& x) {
return (x*x); }
118static inline float128
norm (
const float128& x) {
return fabs(x); }
120using Float = float128;
127#elif defined(_RHEOLEF_HAVE_CLN)
128# include "rheolef/bigfloat.h"
131typedef bigfloat<_RHEOLEF_DIGITS10>
Float;
134#elif defined(_RHEOLEF_HAVE_LONG_DOUBLE)
137typedef long double Float;
148namespace rheolef {
namespace details {
149template <
class T,
class Sfinae =
void>
154typename
std::enable_if<
155 std::is_arithmetic<T>::value
156 || std::is_same<typename std::decay<T>::type,double>::value
160#ifdef _RHEOLEF_HAVE_FLOAT128
163typename
std::enable_if<
164 std::is_same<typename std::decay<T>::type,float128>::value
173namespace rheolef {
namespace details {
174template<
class T,
class Check = T>
187#if !defined(_RHEOLEF_HAVE_SQR_DOUBLE)
189static inline double sqr (
const double& x) {
return (x*x); }
203template <
class T>
T max (
T x,
int y) {
return x > y ? x :
T(y); }
204template <
class T>
T max (
int x,
T y) {
return x > y ?
T(x) : y; }
205template <
class T>
T min (
T x,
int y) {
return x < y ? x :
T(y); }
206template <
class T>
T min (
int x,
T y) {
return x < y ?
T(x) : y; }
208template <
class T>
T abs (
T x) {
return (x >
T(0) ? x : -x); }
see the Float page for the full documentation
double Float
see the Float page for the full documentation
This file is part of Rheolef.
T norm(const vec< T, M > &x)
norm(x): see the expression page for the full documentation
float_traits< T >::type type
helper for std::complex<T>: get basic T type