DHART
Loading...
Searching...
No Matches
Constants.cpp
Go to the documentation of this file.
1
7
8#include <Constants.h>
9#include <numeric>
10#include <cstdlib>
11#include <cmath>
12#include <cassert>
13
14float HF::SpatialStructures::roundhf(float f, float p, float r)
15{
16 assert(p > r);
17 return std::roundf(f * p) * r ;
18}
19
20float HF::SpatialStructures::trunchf(float f, float p, float r)
21{
22 assert(p > r);
23 return std::truncf(f * p) * r;
24}
Contains definitions for the HF::SpatialStructures namespace.
float roundhf(float f, float p=FLOAT_PRECISION, float r=ROUNDING_PRECISION)
Round a float to the nearest precision defined globally. The global values can be overridden with opt...
Definition: Constants.cpp:14
float trunchf(float f, float p=1000.0, float r=0.001)
Truncate a float to the nearest precision defined globally. The global values can be overridden with ...
Definition: Constants.cpp:20