Rev | Line | |
---|
[2] | 1 | #ifndef morpheo_Percent |
---|
| 2 | #define morpheo_Percent |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id$ |
---|
| 6 | * |
---|
| 7 | * [ Description ] |
---|
| 8 | * |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | |
---|
| 13 | inline double percent (double val, double val_max) {return ((val_max == 0)?0:(100.0 * val)/val_max);} |
---|
| 14 | inline double percent (uint32_t val, double val_max) {return (percent(static_cast<double>(val), val_max ));} |
---|
| 15 | inline double percent (double val, uint32_t val_max) {return (percent( val ,static_cast<double>(val_max)));} |
---|
| 16 | inline double percent (uint32_t val, uint32_t val_max) {return (percent(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.