#ifndef morpheo_Percent
#define morpheo_Percent

/*
 * $Id$
 *
 * [ Description ]
 * 
 */

namespace morpheo              {
  
  inline double percent (double   val, double   val_max) {return ((val_max == 0)?0:(100.0 * val)/val_max);}
  inline double percent (uint32_t val, double   val_max) {return (percent(static_cast<double>(val),                    val_max ));}
  inline double percent (double   val, uint32_t val_max) {return (percent(                    val ,static_cast<double>(val_max)));}
  inline double percent (uint32_t val, uint32_t val_max) {return (percent(static_cast<double>(val),static_cast<double>(val_max)));}

}; // end namespace morpheo              

#endif
