signals-cpp
Loading...
Searching...
No Matches
Utils.h
Go to the documentation of this file.
1#pragma once
2#include <algorithm>
3
4namespace signal_utils
5{
10inline bool
11getTimeDelta(double& dt, const double& t0, const double& tf, const double& dt_max = std::numeric_limits<double>::max())
12{
13 if (t0 >= tf || t0 < 0)
14 {
15 return false;
16 }
17 dt = std::min(tf - t0, dt_max);
18 return true;
19}
20
21} // end namespace signal_utils
Definition Utils.h:5
bool getTimeDelta(double &dt, const double &t0, const double &tf, const double &dt_max=std::numeric_limits< double >::max())
Definition Utils.h:11