Skip to content

Releases: VecPP/cste_math

Initial release

09 Sep 03:20
Compare
Choose a tag to compare

The first packaged version of cste_math.

The following are newly added:

Constants

How What
e<T> e
pi<T> π
two_pi<T>
half_pi<T> π/2
quarter_pi<T> π/4
two_pi<T>

Calculus

How What
T absolute(const T& x); |x|
T exponential(const T& x); ex
T modulo(const T& x, const T& y); remainder of x/y
T power(const T& x, const T& y); xy
T square_root(const T& x); √x

Number identification

How What
bool is_inf(const T& x); Checks for infinity
bool is_nan(const T& x); Checks for nan
T sign(const T& x); negative: -1, positive: 1, zero: 0

Rounding

How What
T round_up(const T& x); round number up
T round_down(const T& x); round number down
T round(const T& x); round number to closest integer
T truncate(const T& x); round number towards 0
T fractional(const T& x); The fractional part of the number

Trigonometry functions

How What
T sine(const T& rad); sin(rad)
T cosine(const T& rad); cos(rad)
T tangent(const T& rad); tan(rad)