source: trunk/IPs/systemC/processor/Morpheo/Common/include/Average.h @ 81

Last change on this file since 81 was 81, checked in by rosiere, 16 years ago
  • Finish Environment (and test)
  • Continue predictor_unit
  • Add external tools
  • svn keyword "Id" set
  • Property svn:keywords set to Id
File size: 674 bytes
Line 
1#ifndef morpheo_Average
2#define morpheo_Average
3
4/*
5 * $Id: Average.h 81 2008-04-15 18:40:01Z rosiere $
6 *
7 * [ Description ]
8 *
9 */
10
11namespace morpheo              {
12
13  inline double average (double   val, double   val_max) {return ((val_max == 0)?0:(val/val_max));}
14  inline double average (uint32_t val, double   val_max) {return (average(static_cast<double>(val),                    val_max ));}
15  inline double average (double   val, uint32_t val_max) {return (average(                    val ,static_cast<double>(val_max)));}
16  inline double average (uint32_t val, uint32_t val_max) {return (average(static_cast<double>(val),static_cast<double>(val_max)));}
17 
18}; // end namespace morpheo             
19
20#endif
Note: See TracBrowser for help on using the repository browser.