(my)TinyLibC 0.0.1
little tiny pretty lib c
Loading...
Searching...
No Matches
tlcmaths.h File Reference

Go to the source code of this file.

Macros

#define X_MAX(x, y)   (((x) > (y)) ? (x) : (y))
 maximum of x and y
 
#define X_MIN(x, y)   (((x) < (y)) ? (x) : (y))
 
#define X_E   2.7182818284
 e constant
 
#define X_PI   3.1415926535
 pi constant
 

Functions

int x_max (int a, int b)
 get max int between a and b
 
double x_maxd (double a, double b)
 get max double between a and b
 
float x_maxf (float a, float b)
 get max float between a and b
 
long double x_maxl (long double a, long double b)
 get max long double between a and b
 
int x_min (int a, int b)
 get min int between a and b
 
double x_mind (double a, double b)
 get min double between a and b
 
float x_minf (float a, float b)
 get min float between a and b
 
long double x_minl (long double a, long double b)
 get min long double between a and b
 
double x_pow (double x, double y)
 x raise to the power of y
 
float x_powf (float x, float y)
 x raise to the power of y
 
long double x_powl (long double x, long double y)
 x raise to the power of y
 
double x_sqrt (double x)
 compute the square root of x
 
float x_sqrtf (float x)
 compute the square root of x
 
long double x_sqrtl (long double x)
 compute the square root of x
 

Macro Definition Documentation

◆ X_E

#define X_E   2.7182818284

e constant

Returns
e

Definition at line 35 of file tlcmaths.h.

◆ X_MAX

#define X_MAX (   x,
 
)    (((x) > (y)) ? (x) : (y))

maximum of x and y

Parameters
xnumber 1
ynumber 2
Returns
maximum of x and y
Warning
it's a macro, prefer to use x_max, x_maxd, x_maxf, x_maxl

Definition at line 19 of file tlcmaths.h.

◆ X_MIN

#define X_MIN (   x,
 
)    (((x) < (y)) ? (x) : (y))

Definition at line 28 of file tlcmaths.h.

◆ X_PI

#define X_PI   3.1415926535

pi constant

Returns
pi

Definition at line 41 of file tlcmaths.h.

Function Documentation

◆ x_max()

int x_max ( int  a,
int  b 
)

get max int between a and b

Parameters
ainteger a
binteger b
Returns
a or b

◆ x_maxd()

double x_maxd ( double  a,
double  b 
)

get max double between a and b

Parameters
adouble a
bdouble b
Returns
a or b

◆ x_maxf()

float x_maxf ( float  a,
float  b 
)

get max float between a and b

Parameters
afloat a
bfloat b
Returns
a or b

◆ x_maxl()

long double x_maxl ( long double  a,
long double  b 
)

get max long double between a and b

Parameters
along double a
blong double b
Returns
a or b

◆ x_min()

int x_min ( int  a,
int  b 
)

get min int between a and b

Parameters
ainteger a
binteger b
Returns
a or b

◆ x_mind()

double x_mind ( double  a,
double  b 
)

get min double between a and b

Parameters
adouble a
bdouble b
Returns
a or b

◆ x_minf()

float x_minf ( float  a,
float  b 
)

get min float between a and b

Parameters
afloat a
bfloat b
Returns
a or b

◆ x_minl()

long double x_minl ( long double  a,
long double  b 
)

get min long double between a and b

Parameters
along double a
blong double b
Returns
a or b

◆ x_pow()

double x_pow ( double  x,
double  y 
)

x raise to the power of y

Parameters
xdouble
ydouble
Returns
x raise to the power of y

◆ x_powf()

float x_powf ( float  x,
float  y 
)

x raise to the power of y

Parameters
xfloat
yfloat
Returns
x raise to the power of y

◆ x_powl()

long double x_powl ( long double  x,
long double  y 
)

x raise to the power of y

Parameters
xlong double
ylong double
Returns
x raise to the power of y

◆ x_sqrt()

double x_sqrt ( double  x)

compute the square root of x

Parameters
xdouble
Returns
x if (x <= 1);; square root of x

◆ x_sqrtf()

float x_sqrtf ( float  x)

compute the square root of x

Parameters
xfloat
Returns
x if (x <= 1);; square root of x

◆ x_sqrtl()

long double x_sqrtl ( long double  x)

compute the square root of x

Parameters
xlong double
Returns
x if (x <= 1);; square root of x