summaryrefslogtreecommitdiff
path: root/number.h
diff options
context:
space:
mode:
authorOlivier Gayot <og@satcom1.com>2017-11-19 11:51:41 +0100
committerOlivier Gayot <og@satcom1.com>2017-11-19 16:21:04 +0100
commit5a2d18587b53133bc831967ccd8d6a5dd6e54190 (patch)
treeae31c221b8b86dab255755317132caef2fc38495 /number.h
parent6843dc1272e56e91234deab486781c711436031e (diff)
Added the left-shift computation
Signed-off-by: Olivier Gayot <og@satcom1.com>
Diffstat (limited to 'number.h')
-rw-r--r--number.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/number.h b/number.h
index d93ed70..16fcea6 100644
--- a/number.h
+++ b/number.h
@@ -49,6 +49,14 @@ public:
number operator*(const number &) const;
/**
+ * \brief Return a number equals to this number where n bits have been
+ * shifted to the left.
+ *
+ * \param n Number of bits to shift.
+ */
+ number operator<<(std::uint32_t n) const;
+
+ /**
* \brief Tells whether the number passed as parameter is strictly less
* than this number.
*
@@ -104,6 +112,13 @@ public:
number &operator+=(const number &n);
/**
+ * \brief Shift the number n bits to the left.
+ *
+ * \param n Number of bits to shift.
+ */
+ number &operator<<=(std::uint32_t);
+
+ /**
* \brief Increment this number.
*/
number &operator++();