summaryrefslogtreecommitdiffstats
path: root/src/import/generic/memory/lib/utils/num.H
diff options
context:
space:
mode:
Diffstat (limited to 'src/import/generic/memory/lib/utils/num.H')
-rw-r--r--src/import/generic/memory/lib/utils/num.H31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/import/generic/memory/lib/utils/num.H b/src/import/generic/memory/lib/utils/num.H
index 62332bb65..327aca84f 100644
--- a/src/import/generic/memory/lib/utils/num.H
+++ b/src/import/generic/memory/lib/utils/num.H
@@ -22,3 +22,34 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
+
+///
+/// @file num.H
+/// @brief Miscellaneous number checking functions
+///
+// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
+// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
+// *HWP Team: Memory
+// *HWP Level: 3
+// *HWP Consumed by: HB:FSP
+
+#ifndef _GEN_MSS_NUM_H_
+#define _GEN_MSS_NUM_H_
+
+namespace mss
+{
+
+///
+/// @brief Return whether or not a number is odd
+/// @param[in] i_number the number to check
+/// @return true if i_number is odd
+///
+template< typename T >
+constexpr bool is_odd(const T i_number)
+{
+ return (i_number & 0x1);
+}
+
+
+}
+#endif
OpenPOWER on IntegriCloud