file header and comments supplied

This commit is contained in:
Uwe Jakobeit
2026-04-02 09:27:44 +02:00
parent 0f5dcade23
commit 5ee5ee8d9a

View File

@@ -1,5 +1,15 @@
#ifndef 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 <cmath>
@@ -11,7 +21,10 @@
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) {
return (x < lo) ? lo : (x > hi) ? hi : x;
}