ifw-odp 5.0.0
Loading...
Searching...
No Matches
clipm_priv_math.h
Go to the documentation of this file.
1
2/*********************************************************************
3 * E.S.O. - VLT project
4 *
5 * "@(#) $Id: clipm_priv_math.h 166626 2008-04-24 15:49:12Z hlorch $"
6 *
7 * Inline, non-public functions for basic mathematical operations
8 *
9 * who when what
10 * -------- ---------- ----------------------------------------------
11 * hlorch 2006-08-21 created
12 */
13
28#ifndef CLIPM_PRIV_MATH_H
29#define CLIPM_PRIV_MATH_H
30
31/*-----------------------------------------------------------------------------
32 Includes
33 -----------------------------------------------------------------------------*/
34
35/*-----------------------------------------------------------------------------
36 Function Macros
37 -----------------------------------------------------------------------------*/
38
39/*----------------------------------------------------------------------------*/
46/*----------------------------------------------------------------------------*/
47#define clipm_priv_math_max(a, b) \
48 ((a) > (b) ? (a) : (b))
49
50/*----------------------------------------------------------------------------*/
57/*----------------------------------------------------------------------------*/
58#define clipm_priv_math_min(a, b) \
59 ((a) < (b) ? (a) : (b))
60
61/*----------------------------------------------------------------------------*/
67/*----------------------------------------------------------------------------*/
68#define clipm_priv_math_sign(in) \
69 ((in) >= 0 ? 1 : -1)
70
71/*-----------------------------------------------------------------------------
72 Declaration Block
73 -----------------------------------------------------------------------------*/
74
75#ifdef __cplusplus
76extern "C" {
77#endif
78
79/*----------------------------------------------------------------------------*/
87/*----------------------------------------------------------------------------*/
88#define clipm_priv_math_round_d2i(in) \
89 ((in < 0) ? (int)(in - 0.5) : (int)(in + 0.5))
90
92/*----------------------------------------------------------------------------*/
93
94#ifdef __cplusplus
95} /* extern "C" */
96#endif
97
98#endif /* CLIPM_PRIV_MATH_H */