vtf-logo

sign.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00008 #if !defined(__ads_sign_h__)
00009 #define __ads_sign_h__
00010 
00011 #include "../defs.h"
00012 
00013 BEGIN_NAMESPACE_ADS
00014 
00015 //-----------------------------------------------------------------------------
00017 // @{
00018 
00025 template<typename T>
00026 inline 
00027 int
00028 sign(const T x) {
00029   if (x > 0) {
00030     return 1;
00031   }
00032   else if (x < 0) {
00033     return -1;
00034   }
00035   return 0;
00036 }
00037 
00038 // @}
00039 
00040 END_NAMESPACE_ADS
00041 
00042 #endif

Generated on Fri Aug 24 12:55:28 2007 for Algorithms and Data Structures Package by  doxygen 1.4.7