#ifndef Morpheo_Percent_h
#define Morpheo_Percent_h

/*
 * $Id: Percent.h 88 2008-12-10 18:31:39Z rosiere $
 *
 * [ 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
