file header and comments supplied
This commit is contained in:
15
app/util.h
15
app/util.h
@@ -1,5 +1,15 @@
|
|||||||
#ifndef UTIL_H
|
#ifndef UTIL_H
|
||||||
#define UTIL_H
|
#define UTIL_H
|
||||||
|
/*
|
||||||
|
File: util.h
|
||||||
|
Description: This is a C++ header file containing utility functions
|
||||||
|
Rev: 0.1
|
||||||
|
Created: 01.04.26
|
||||||
|
Author: Uwe Jakobeit
|
||||||
|
Copyright: Binder GmbH TUT
|
||||||
|
Purpose: Supply utility functions for math. evaluation, validation, conversion
|
||||||
|
Notes: [Any relevant details, such as dependencies, usage examples, or known issues.]
|
||||||
|
*/
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
@@ -11,7 +21,10 @@
|
|||||||
|
|
||||||
namespace UTILITY_FUNCTIONS {
|
namespace UTILITY_FUNCTIONS {
|
||||||
|
|
||||||
|
// determine if x is in range of ]lo;hi[
|
||||||
|
// if so - x will be returned
|
||||||
|
// if not - lo will be returned if x is smaller than lo
|
||||||
|
// - hi will be returned if x is greater than hi
|
||||||
inline double limit(double x, double lo, double hi) {
|
inline double limit(double x, double lo, double hi) {
|
||||||
return (x < lo) ? lo : (x > hi) ? hi : x;
|
return (x < lo) ? lo : (x > hi) ? hi : x;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user