MGIS
Loading...
Searching...
No Matches
Cste.hxx File Reference
#include <limits>
#include "MGIS/Config.hxx"

Classes

struct  mgis::Cste
 

Namespaces

namespace  mgis
 the namespace mgis encloses all the MGIS project.
 

Functions

template<typename T >
constexpr T mgis::internals::abs (const T v)
 compute the absolute value of a number using a constexpr function.
 
template<typename T >
constexpr T mgis::internals::sqrt_helper (const T x, const T g)
 
template<typename T >
constexpr T mgis::internals::sqrt (const T v)
 compute the square root of a number using the Heron algorithm using a constexpr function.
 

Detailed Description

Author
Thomas Helfer
Date
03/09/2018

Function Documentation

◆ sqrt()

template<typename T >
constexpr T mgis::internals::sqrt ( const T  v)
constexpr

compute the square root of a number using the Heron algorithm using a constexpr function.

This function is meant to compute some usefull constant such as sqrt(2) and sqrt(3) at compile-time.

Template Parameters
T: numerical type
Precondition
T must be a floatting point type
std::numeric_limits<T>::epsilon must be defined