Namespaces | Defines | Functions

OS_NS_math.h File Reference

#include "ace/config-all.h"
#include "ace/os_include/os_math.h"
Include dependency graph for OS_NS_math.h:
This graph shows which files directly or indirectly include this file:

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.


Defines

#define ACE_EXPORT_MACRO   ACE_Export

Functions

double ace_log2_helper (double x)
template<typename T >
ACE_OS::floor (T x)
 This method computes the largest integral value not greater than x.
template<typename T >
ACE_OS::ceil (T x)
 This method computes the smallest integral value not less than x.
double ACE_OS::log2 (double x)
 This method computes the base-2 logarithm of x.

Detailed Description

Id:
OS_NS_math.h 89470 2010-03-12 12:12:12Z olli
Author:
Douglas C. Schmidt <schmidt@cs.wustl.edu>
Jesper S. M|ller<stophph@diku.dk>
and a cast of thousands...

Originally in OS.h.

Definition in file OS_NS_math.h.


Define Documentation

#define ACE_EXPORT_MACRO   ACE_Export

Definition at line 35 of file OS_NS_math.h.


Function Documentation

double ace_log2_helper ( double  x  )  [inline]

Definition at line 45 of file OS_NS_math.h.

{
#if defined (log2)
  return log2 (x);
#undef log2
#else
#  if !defined (ACE_LACKS_LOG2)
  return ACE_STD_NAMESPACE::log2 (x);
#  else
  /*
    ==================================================================

                log (x)
                   k
      log (x) = -------
         b      log (b)
                   k

    meaning the binary logarithm of x using the natural logarithm, for
    example, is:


                log (x)
                   e
      log (x) = -------
         2      log (2)
                   e

    ==================================================================
   */

  // Precomputed value of 1/log(2.0).  Saves an expensive division and
  // computing log(2.0) in each call.
  double const _1_ln2 = 1.442695040888963407359924681002;

  return log (x) * _1_ln2;
#  endif /* !ACE_LACKS_LOG2 */
#endif /* defined (log2) */
}

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines