aboutsummaryrefslogtreecommitdiff
path: root/externals/ace/OS_NS_math.h
diff options
context:
space:
mode:
authorXanadu <none@none>2010-07-20 02:49:28 +0200
committerXanadu <none@none>2010-07-20 02:49:28 +0200
commit79622802f397258ee0f34327ba3ae6977ca3e7ff (patch)
tree1868946c234ab9ee256a6b7766a15713eae94235 /externals/ace/OS_NS_math.h
parent7dd2dc91816ab8b3bc3b99a1b1c99c7ea314d5a8 (diff)
parentf906976837502fa5aa81b982b901d1509f5aa0c4 (diff)
Merge. Revision history for source files should be all back now.
--HG-- branch : trunk rename : sql/CMakeLists.txt => sql/tools/CMakeLists.txt rename : src/server/game/Pools/PoolHandler.cpp => src/server/game/Pools/PoolMgr.cpp rename : src/server/game/Pools/PoolHandler.h => src/server/game/Pools/PoolMgr.h rename : src/server/game/PrecompiledHeaders/NixCorePCH.cpp => src/server/game/PrecompiledHeaders/gamePCH.cpp rename : src/server/game/PrecompiledHeaders/NixCorePCH.h => src/server/game/PrecompiledHeaders/gamePCH.h
Diffstat (limited to 'externals/ace/OS_NS_math.h')
-rw-r--r--externals/ace/OS_NS_math.h121
1 files changed, 121 insertions, 0 deletions
diff --git a/externals/ace/OS_NS_math.h b/externals/ace/OS_NS_math.h
new file mode 100644
index 00000000000..9ba3b6632ad
--- /dev/null
+++ b/externals/ace/OS_NS_math.h
@@ -0,0 +1,121 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file OS_NS_math.h
+ *
+ * $Id: OS_NS_math.h 89470 2010-03-12 12:12:12Z olli $
+ *
+ * @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
+ * @author Jesper S. M|ller<stophph@diku.dk>
+ * @author and a cast of thousands...
+ *
+ * Originally in OS.h.
+ */
+//=============================================================================
+
+#ifndef ACE_OS_NS_MATH_H
+# define ACE_OS_NS_MATH_H
+
+# include /**/ "ace/pre.h"
+
+# include "ace/config-all.h"
+
+# if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+# endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/os_include/os_math.h"
+
+#include /**/ "ace/ACE_export.h"
+
+#if defined (ACE_EXPORT_MACRO)
+# undef ACE_EXPORT_MACRO
+#endif
+#define ACE_EXPORT_MACRO ACE_Export
+
+
+/*
+ * We inline and undef some functions that may be implemented
+ * as macros on some platforms. This way macro definitions will
+ * be usable later as there is no way to save the macro definition
+ * using the pre-processor.
+ *
+ */
+inline double ace_log2_helper (double x)
+{
+#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) */
+}
+
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace ACE_OS
+{
+ /// This method computes the largest integral value not greater than x.
+ template <typename T>
+ T floor (T x)
+ {
+ return ACE_STD_NAMESPACE::floor (x);
+ }
+
+ /// This method computes the smallest integral value not less than x.
+ template <typename T>
+ T ceil (T x)
+ {
+ return ACE_STD_NAMESPACE::ceil (x);
+ }
+
+ /// This method computes the base-2 logarithm of x.
+ ACE_NAMESPACE_INLINE_FUNCTION
+ double log2 (double x);
+
+} /* namespace ACE_OS */
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+# if defined (ACE_HAS_INLINED_OSCALLS)
+# if defined (ACE_INLINE)
+# undef ACE_INLINE
+# endif /* ACE_INLINE */
+# define ACE_INLINE inline
+# include "ace/OS_NS_math.inl"
+# endif /* ACE_HAS_INLINED_OSCALLS */
+
+# include /**/ "ace/post.h"
+#endif /* ACE_OS_NS_MATH_H */