3 //=============================================================================
7 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
8 * @author Jesper S. M|ller<stophph@diku.dk>
9 * @author and a cast of thousands...
11 //=============================================================================
13 #ifndef ACE_OS_NS_MATH_H
14 # define ACE_OS_NS_MATH_H
16 # include /**/ "ace/pre.h"
18 # include "ace/config-all.h"
20 # if !defined (ACE_LACKS_PRAGMA_ONCE)
22 # endif /* ACE_LACKS_PRAGMA_ONCE */
24 #include "ace/os_include/os_math.h"
27 #include /**/ "ace/ACE_export.h"
29 #if defined (ACE_EXPORT_MACRO)
30 # undef ACE_EXPORT_MACRO
32 #define ACE_EXPORT_MACRO ACE_Export
36 * We inline and undef some functions that may be implemented
37 * as macros on some platforms. This way macro definitions will
38 * be usable later as there is no way to save the macro definition
39 * using the pre-processor.
41 inline double ace_log2_helper (double x
)
47 # if !defined (ACE_LACKS_LOG2)
51 ==================================================================
59 meaning the binary logarithm of x using the natural logarithm, for
69 ==================================================================
72 // Precomputed value of 1/log(2.0). Saves an expensive division and
73 // computing log(2.0) in each call.
74 double const _1_ln2
= 1.442695040888963407359924681002;
76 return log (x
) * _1_ln2
;
77 # endif /* !ACE_LACKS_LOG2 */
78 #endif /* defined (log2) */
82 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
86 /// This method computes the largest integral value not greater than x.
91 return std::floor (x
);
94 /// This method computes the smallest integral value not less than x.
102 /// This method computes the base-2 logarithm of x.
103 ACE_NAMESPACE_INLINE_FUNCTION
104 double log2 (double x
);
105 } /* namespace ACE_OS */
107 ACE_END_VERSIONED_NAMESPACE_DECL
109 # if defined (ACE_HAS_INLINED_OSCALLS)
110 # if defined (ACE_INLINE)
112 # endif /* ACE_INLINE */
113 # define ACE_INLINE inline
114 # include "ace/OS_NS_math.inl"
115 # endif /* ACE_HAS_INLINED_OSCALLS */
117 # include /**/ "ace/post.h"
118 #endif /* ACE_OS_NS_MATH_H */