3 //=============================================================================
7 * $Id: OS_NS_math.h 80826 2008-03-04 14:51:23Z wotte $
9 * @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
10 * @author Jesper S. M|ller<stophph@diku.dk>
11 * @author and a cast of thousands...
15 //=============================================================================
17 #ifndef ACE_OS_NS_MATH_H
18 # define ACE_OS_NS_MATH_H
20 # include /**/ "ace/pre.h"
22 # include "ace/config-all.h"
24 # if !defined (ACE_LACKS_PRAGMA_ONCE)
26 # endif /* ACE_LACKS_PRAGMA_ONCE */
28 #include "ace/os_include/os_math.h"
30 #include /**/ "ace/ACE_export.h"
32 #if defined (ACE_EXPORT_MACRO)
33 # undef ACE_EXPORT_MACRO
35 #define ACE_EXPORT_MACRO ACE_Export
39 * We inline and undef some functions that may be implemented
40 * as macros on some platforms. This way macro definitions will
41 * be usable later as there is no way to save the macro definition
42 * using the pre-processor.
45 inline double ace_log2_helper (double x
)
51 # if !defined (ACE_LACKS_LOG2)
52 return ACE_STD_NAMESPACE::log2 (x
);
55 ==================================================================
63 meaning the binary logarithm of x using the natural logarithm, for
73 ==================================================================
76 // Precomputed value of 1/log(2.0). Saves an expensive division and
77 // computing log(2.0) in each call.
78 double const _1_ln2
= 1.442695040888963407359924681002;
80 return log (x
) * _1_ln2
;
81 # endif /* !ACE_LACKS_LOG2 */
82 #endif /* defined (log2) */
86 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
90 /// This method computes the largest integral value not greater than x.
91 ACE_NAMESPACE_INLINE_FUNCTION
92 double floor (double x
);
94 /// This method computes the smallest integral value not less than x.
95 ACE_NAMESPACE_INLINE_FUNCTION
96 double ceil (double x
);
98 /// This method computes the base-2 logarithm of x.
99 ACE_NAMESPACE_INLINE_FUNCTION
100 double log2 (double x
);
102 } /* namespace ACE_OS */
104 ACE_END_VERSIONED_NAMESPACE_DECL
106 # if defined (ACE_HAS_INLINED_OSCALLS)
107 # if defined (ACE_INLINE)
109 # endif /* ACE_INLINE */
110 # define ACE_INLINE inline
111 # include "ace/OS_NS_math.inl"
112 # endif /* ACE_HAS_INLINED_OSCALLS */
114 # include /**/ "ace/post.h"
115 #endif /* ACE_OS_NS_MATH_H */