Gocator API

- Home
- Types
- Files

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