ifw-odp  4.0.0-pre1
clipm_priv_math.h File Reference

Go to the source code of this file.

Macros

#define clipm_priv_math_max(a, b)    ((a) > (b) ? (a) : (b))
 Get the maximum. More...
 
#define clipm_priv_math_min(a, b)    ((a) < (b) ? (a) : (b))
 Get the minimum. More...
 
#define clipm_priv_math_sign(in)    ((in) >= 0 ? 1 : -1)
 Get the sign of a number. More...
 
#define clipm_priv_math_round_d2i(in)    ((in < 0) ? (int)(in - 0.5) : (int)(in + 0.5))
 Round a value to the nearest integer. More...
 

Macro Definition Documentation

◆ clipm_priv_math_max

#define clipm_priv_math_max (   a,
 
)     ((a) > (b) ? (a) : (b))

Get the maximum.

Parameters
aNumber a
bNumber b
Returns
The maximum

◆ clipm_priv_math_min

#define clipm_priv_math_min (   a,
 
)     ((a) < (b) ? (a) : (b))

Get the minimum.

Parameters
aNumber a
bNumber b
Returns
The minimum

◆ clipm_priv_math_round_d2i

#define clipm_priv_math_round_d2i (   in)     ((in < 0) ? (int)(in - 0.5) : (int)(in + 0.5))

Round a value to the nearest integer.

Parameters
inInput value
Returns
The rounded value

This macro is intended to replace the non-ANSI-C function rint().

◆ clipm_priv_math_sign

#define clipm_priv_math_sign (   in)     ((in) >= 0 ? 1 : -1)

Get the sign of a number.

Parameters
inInput value
Returns
+1 if (in >= 0), else -1