#include "ace/os_include/os_math.h"

Go to the source code of this file.
Namespaces | |
| namespace | ACE_OS |
This namespace defines an OS independent programming API that shields developers from nonportable aspects of writing efficient system programs on Win32, POSIX and other versions of UNIX, and various real-time operating systems. | |
Functions | |
| double | ace_log2_helper (double x) |
| ACE_NAMESPACE_INLINE_FUNCTION double | ACE_OS::floor (double x) |
| This method computes the largest integral value not greater than x. | |
| ACE_NAMESPACE_INLINE_FUNCTION double | ACE_OS::ceil (double x) |
| This method computes the smallest integral value not less than x. | |
| ACE_NAMESPACE_INLINE_FUNCTION double | ACE_OS::log2 (double x) |
| This method computes the base-2 logarithm of x. | |
Originally in OS.h.
Definition in file OS_NS_math.h.
| double ace_log2_helper | ( | double | x | ) | [inline] |
Definition at line 45 of file OS_NS_math.h.
00046 { 00047 #if defined (log2) 00048 return log2 (x); 00049 #undef log2 00050 #else 00051 # if !defined (ACE_LACKS_LOG2) 00052 return ACE_STD_NAMESPACE::log2 (x); 00053 # else 00054 /* 00055 ================================================================== 00056 00057 log (x) 00058 k 00059 log (x) = ------- 00060 b log (b) 00061 k 00062 00063 meaning the binary logarithm of x using the natural logarithm, for 00064 example, is: 00065 00066 00067 log (x) 00068 e 00069 log (x) = ------- 00070 2 log (2) 00071 e 00072 00073 ================================================================== 00074 */ 00075 00076 // Precomputed value of 1/log(2.0). Saves an expensive division and 00077 // computing log(2.0) in each call. 00078 double const _1_ln2 = 1.442695040888963407359924681002; 00079 00080 return log (x) * _1_ln2; 00081 # endif /* !ACE_LACKS_LOG2 */ 00082 #endif /* defined (log2) */ 00083 }
1.6.1