Index: uspace/lib/c/Makefile
===================================================================
--- uspace/lib/c/Makefile	(revision f52ce72297a1fb0d499b966c3d9a3f0ab18eef6d)
+++ uspace/lib/c/Makefile	(revision 8f18f1e33a01dcf632beb3a28f801bd5939ced10)
@@ -208,5 +208,6 @@
 	test/double_to_str.c \
 	test/getopt.c \
-	test/uuid.c
+	test/uuid.c \
+	test/imath.c
 
 include $(USPACE_PREFIX)/Makefile.common
Index: uspace/lib/c/test/imath.c
===================================================================
--- uspace/lib/c/test/imath.c	(revision 8f18f1e33a01dcf632beb3a28f801bd5939ced10)
+++ uspace/lib/c/test/imath.c	(revision 8f18f1e33a01dcf632beb3a28f801bd5939ced10)
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2019 Matthieu Riolo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <pcut/pcut.h>
+#include <imath.h>
+
+static uint64_t MAX_NUM = 10000000000000000000U;
+static unsigned MAX_EXP = 19;
+
+PCUT_INIT;
+
+PCUT_TEST_SUITE(imath);
+
+PCUT_TEST(ipow10_u64_zero)
+{
+	errno_t ret;
+	uint64_t result;
+	ret = ipow10_u64(0, &result);
+
+	PCUT_ASSERT_ERRNO_VAL(EOK, ret);
+	PCUT_ASSERT_INT_EQUALS(1, result);
+}
+
+PCUT_TEST(ipow10_u64_one)
+{
+	errno_t ret;
+	uint64_t result;
+	ret = ipow10_u64(1, &result);
+
+	PCUT_ASSERT_ERRNO_VAL(EOK, ret);
+	PCUT_ASSERT_INT_EQUALS(10, result);
+}
+
+PCUT_TEST(ipow10_u64_max)
+{
+	errno_t ret;
+	uint64_t result;
+	ret = ipow10_u64(MAX_EXP, &result);
+
+	PCUT_ASSERT_ERRNO_VAL(EOK, ret);
+	PCUT_ASSERT_INT_EQUALS(MAX_NUM, result);
+}
+
+PCUT_TEST(ipow10_u64_too_large)
+{
+	errno_t ret;
+	uint64_t result;
+	ret = ipow10_u64(MAX_EXP + 1, &result);
+
+	PCUT_ASSERT_ERRNO_VAL(ERANGE, ret);
+}
+
+PCUT_TEST(ilog10_u64_zero)
+{
+	unsigned ret = ilog10_u64(0);
+	PCUT_ASSERT_INT_EQUALS(0, ret);
+}
+
+PCUT_TEST(ilog10_u64_one)
+{
+	unsigned ret = ilog10_u64(1);
+	PCUT_ASSERT_INT_EQUALS(0, ret);
+}
+
+PCUT_TEST(ilog10_u64_max)
+{
+	unsigned ret = ilog10_u64(MAX_NUM);
+	PCUT_ASSERT_INT_EQUALS(MAX_EXP, ret);
+}
+
+PCUT_EXPORT(imath);
Index: uspace/lib/c/test/main.c
===================================================================
--- uspace/lib/c/test/main.c	(revision f52ce72297a1fb0d499b966c3d9a3f0ab18eef6d)
+++ uspace/lib/c/test/main.c	(revision 8f18f1e33a01dcf632beb3a28f801bd5939ced10)
@@ -52,4 +52,5 @@
 PCUT_IMPORT(getopt);
 PCUT_IMPORT(uuid);
+PCUT_IMPORT(imath);
 
 PCUT_MAIN();
