Gocator API

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-2020 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 kBeginHeader()
17
18 #define GO_UTILS_STREAM_ID_SEPARATOR '-'
19
20 /**
21 * Returns true if input is within min and max.
22 */
23 #define GoUtils_MinMax_(in, min, max) \
24 (((in) > (max) || (in) < (min)) ? (kFALSE) : (kTRUE))
25
26 /**
27 * Returns the result of a floating point number equivalence, based on a given degree of precision.
28 *
29 * @public @memberof GoUtils
30 * @version Introduced in firmware 4.0.10.27
31 * @param first k64f object.
32 * @param second k64f object.
33 * @param decimalPrecision k8u object.
34 * @return Returns kTRUE if the numbers are equivalent within the given precision; kFALSE otherwise.
35 */
36 GoFx(kBool) GoUtils_FuzzyEquivalence(k64f first, k64f second, k8u decimalPrecision);
37
38 kEndHeader()
39 #include <GoSdk/GoUtils.x.h>
40
41 #endif
kString.h
k8u
GoSdkDef.h
Essential SDK declarations.
k64f
kBool