1 #ifndef __Base_Math_Utils_hh__
2 #define __Base_Math_Utils_hh__
4 #define _USE_MATH_DEFINES
12 #ifndef CONSOLE_PRECISION_DIGITS
13 # define CONSOLE_PRECISION_DIGITS 10
14 #endif // CONSOLE_PRECISION_DIGITS
25 inline void sincos(
const float xRad,
float & s,
float & c)
30 inline void sincos(
const double xRad,
double & s,
double & c)
39 inline float lerp(
const float a,
const float b,
const float f)
43 inline double lerp(
const double a,
const double b,
const double f)
56 std::streambuf *pb = os.rdbuf();
60 ( (pb==std::cout.rdbuf())
61 || (pb==std::cerr.rdbuf()) );
72 # pragma warning(push, 2)
78 if (std::numeric_limits<T>::is_integer){
80 return std::numeric_limits<T>::digits10 +1;
83 return std::numeric_limits<T>::digits;
92 #endif // __Operators_hh__
bool IsConsoleStream(const std::ostream &os)
Helper returning true on console ostreams like cerr, cout Useful to distinguish between console (cout...
void sincos(const float xRad, float &s, float &c)
computes sin and cosinus with float precision
unsigned int DecimalsToStore()
determien the number of deciamls to store, w.g.
float lerp(const float a, const float b, const float f)
linear interpolation Cg equivalent function.