OS_NS_math.inl

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // OS_NS_math.inl,v 1.8 2006/04/02 01:10:56 schmidt Exp
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_OS namespace
00034 
00035 ACE_END_VERSIONED_NAMESPACE_DECL

Generated on Thu Nov 9 09:41:57 2006 for ACE by doxygen 1.3.6