Gocator API
 All Classes Files Functions Variables Typedefs Macros Modules Pages
GoUtils.h
Go to the documentation of this file.
1 /**
2  * @file GoUtils.h
3  * @brief Contains various helper functions.
4  *
5  * @internal
6  * Copyright (C) 2016-2022 by LMI Technologies Inc.
7  * Licensed under the MIT License.
8  * Redistributed files must retain the above copyright notice.
9  */
10 #ifndef GO_SDK_UTILS_H
11 #define GO_SDK_UTILS_H
12 
13 #include <GoSdk/GoSdkDef.h>
14 #include <kApi/Data/kString.h>
15 #include <math.h>
16 
17 #define GO_UTILS_STREAM_ID_SEPARATOR '-'
18 
19 /**
20  * Returns true if input is within min and max.
21  */
22 #define GoUtils_MinMax_(in, min, max) \
23  (((in) > (max) || (in) < (min)) ? (kFALSE) : (kTRUE))
24 
25 /**
26  * Returns the result of a floating point number equivalence, based on a given degree of precision.
27  *
28  * @public @memberof GoUtils
29  * @version Introduced in firmware 4.0.10.27
30  * @param first k64f object.
31  * @param second k64f object.
32  * @param decimalPrecision k8u object.
33  * @return Returns kTRUE if the numbers are equivalent within the given precision; kFALSE otherwise.
34  */
35 GoFx(kBool) GoUtils_FuzzyEquivalence(k64f first, k64f second, k8u decimalPrecision);
36 
37 #include <GoSdk/GoUtils.x.h>
38 
39 #endif
Essential SDK declarations.