OS_NS_math.inl

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // $Id: OS_NS_math.inl 80826 2008-03-04 14:51:23Z wotte $
00004 
00005 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00006 
00007 namespace ACE_OS {
00008 
00009   ACE_INLINE double
00010   floor (double x)
00011   {
00012     // This method computes the largest integral value not greater than x.
00013     if(x > 0)
00014       return static_cast<long> (x);
00015     else if (static_cast<long> (x) == x)
00016       return x;
00017     else
00018       return static_cast<long>(x) - 1;
00019   }
00020 
00021   ACE_INLINE double
00022   ceil (double x)
00023   {
00024     // This method computes the smallest integral value not less than x.
00025     if (x < 0)
00026       return static_cast<long> (x);
00027     else if (static_cast<long> (x) == x)
00028       return x;
00029     else
00030       return static_cast<long> (x) + 1;
00031   }
00032 
00033   ACE_INLINE double
00034   log2 (double x)
00035   {
00036     return ace_log2_helper (x);
00037   }
00038 
00039 } // ACE_OS namespace
00040 
00041 ACE_END_VERSIONED_NAMESPACE_DECL

Generated on Tue Feb 2 17:18:41 2010 for ACE by  doxygen 1.4.7