OS_NS_math.inl

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // $Id: OS_NS_math.inl 78441 2007-05-22 11:12:07Z olli $
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 Sun Jan 27 12:05:33 2008 for ACE by doxygen 1.3.6