Rpi-hw  0.7.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Functions | Variables
rpihw::math Namespace Reference

Namespace of the mathematical functions. More...

Functions

template<typename T >
abs (T x)
 Returns the absolute value of x.
 
template<typename T >
floor (T x)
 Returns the nearest integer not greater than x.
 
template<typename T >
ceil (T x)
 Returns the nearest integer not less than x.
 
template<typename T >
round (T x)
 Returns the nearest integer to x.
 
template<typename T >
min (T x, T y)
 Returns the lesser of x and y
 
template<typename T >
max (T x, T y)
 Returns the greater of x and y
 
template<typename T >
between (T x, T y, T z)
 Returns x between y and z
 
template<typename T >
sign (T x)
 Returns the sign of x
 
template<typename T >
cmp (T x, T y)
 Returns -1 if x is less than y; 1 if x is greater than y, and 0 if they are equal.
 
template<typename T >
pow (T x, T y)
 Returns x raised to the power y
 
template<typename T >
square (T x)
 Returns the square of x
 
template<typename T >
cube (T x)
 Returns the cube of x
 
template<typename T >
sqrt (T x)
 Returns the square root of x
 
template<typename T >
log (T x)
 Returns the natural logarithm of x
 
template<typename T >
log2 (T x)
 Returns the base-2 logarithm of x
 
template<typename T >
rad (T x)
 Returns the angle x expressed in radians.
 
template<typename T >
deg (T x)
 Returns the angle x expressed in degrees.
 
template<typename T >
sin (T x)
 Returns the sine of an angle of x radians.
 
template<typename T >
cos (T x)
 Returns the cosine of an angle of x radians.
 
template<typename T >
tan (T x)
 Returns the tangent of an angle of x radians.
 
template<typename T >
atan (T x)
 Returns the arctangent of x, expressed in radians.
 
size_t fast_log2 (size_t x)
 Returns the base-2 logarithm of x
 
size_t fast_pow2 (size_t x)
 Returns 2 raised to the power x
 

Variables

const double PI = M_PI
 Pi, the ratio of a circle's circumference to its diameter.
 
const double INF = INFINITY
 The infinity constant.
 
const double LOG2 = 0.6931471
 The natural logarithm of 2.
 

Detailed Description

Namespace of the mathematical functions.