summaryrefslogtreecommitdiffstats
path: root/source/rainerscript/functions/rs-int2hex.rst
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 16:27:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 16:27:18 +0000
commitf7f20c3f5e0be02585741f5f54d198689ccd7866 (patch)
tree190d5e080f6cbcc40560b0ceaccfd883cb3faa01 /source/rainerscript/functions/rs-int2hex.rst
parentInitial commit. (diff)
downloadrsyslog-doc-f7f20c3f5e0be02585741f5f54d198689ccd7866.tar.xz
rsyslog-doc-f7f20c3f5e0be02585741f5f54d198689ccd7866.zip
Adding upstream version 8.2402.0+dfsg.upstream/8.2402.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'source/rainerscript/functions/rs-int2hex.rst')
-rw-r--r--source/rainerscript/functions/rs-int2hex.rst56
1 files changed, 56 insertions, 0 deletions
diff --git a/source/rainerscript/functions/rs-int2hex.rst b/source/rainerscript/functions/rs-int2hex.rst
new file mode 100644
index 0000000..29cbbdd
--- /dev/null
+++ b/source/rainerscript/functions/rs-int2hex.rst
@@ -0,0 +1,56 @@
+*********
+int2hex()
+*********
+
+Purpose
+=======
+
+int2hex(num)
+
+Returns a hexadecimal number string of a given positive integer num.
+
+.. note::
+
+ When a negative integer is given the return value will be the
+ `Two's complement <https://en.wikipedia.org/wiki/Two%27s_complement>`_ of
+ the input number.
+
+
+Example
+=======
+
+
+Positive Integer given
+----------------------
+
+In the following example the hexadecimal number of 61 is returned
+as a string.
+
+.. code-block:: none
+
+ int2hex(61)
+
+produces
+
+.. code-block:: none
+
+ 3d
+
+
+Negative Integer given
+----------------------
+
+This example shows the result on a 64-bit system when a negative
+integer such as -13 is put into the function.
+
+.. code-block:: none
+
+ int2hex(-13)
+
+produces
+
+.. code-block:: none
+
+ fffffffffffffff3
+
+