|
OMNeT++ API 6.1
Discrete Event Simulation Library
|
|
16 #ifndef __OMNETPP_SIMTIMEMATH_H
17 #define __OMNETPP_SIMTIMEMATH_H
29 inline int64_t _i64mod(
const int64_t& any_t,
const int64_t& positive_u)
31 int64_t m = any_t % positive_u;
32 return m>=0 ? m : m+positive_u;
54 int64_t off = offset.
raw();
55 int64_t u = unit.
raw();
56 int64_t t = x.
raw() - off;
66 int64_t t = x.
raw() + u-1;
76 int64_t off = offset.
raw();
77 int64_t u = unit.
raw();
78 int64_t t = x.
raw() - off + u-1;
87 return x.
raw()<0 ? -x : x;
134 SIM_API int64_t
preciseDiv(int64_t x,
const SimTime& y, int64_t& fractionNumerator, int64_t& fractionDenominator);
const SimTime & setRaw(int64_t l)
Definition: simtime.h:436
int64_t-based, base-10 fixed-point simulation time.
Definition: simtime.h:66
const SimTime fmod(const SimTime &x, const SimTime &y)
Computes the remainder of the division of two simulation times.
Definition: simtimemath.h:120
const SimTime ceil(const SimTime &x, const SimTime &unit, const SimTime &offset=SimTime())
Generalized version of ceil(), accepting a unit and an offset: ceil(x,u,off) = ceil((x-off)/u)*u + of...
Definition: simtimemath.h:74
static int64_t getScale()
Definition: simtime.h:448
const SimTime floor(const SimTime &x, const SimTime &unit, const SimTime &offset=SimTime())
Generalized version of floor(), accepting a unit and an offset: floor(x,u,off) = floor((x-off)/u)*u +...
Definition: simtimemath.h:52
int64_t div(const SimTime &x, const SimTime &y)
Computes the quotient of the simulation times x and y. The quotient is the algebraic quotient with an...
Definition: simtimemath.h:100
SIM_API int64_t preciseDiv(int64_t x, const SimTime &y, int64_t &fractionNumerator, int64_t &fractionDenominator)
Precise division of an integer and a simulation time.
const SimTime fabs(const SimTime &x)
Returns the absolute value of the simulation time x.
Definition: simtimemath.h:85
int64_t raw() const
Definition: simtime.h:426