aboutsummaryrefslogtreecommitdiff
path: root/math/log2f.c
diff options
context:
space:
mode:
Diffstat (limited to 'math/log2f.c')
-rw-r--r--math/log2f.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/math/log2f.c b/math/log2f.c
index 0a44fa2024f6..7d47379b41cb 100644
--- a/math/log2f.c
+++ b/math/log2f.c
@@ -1,13 +1,15 @@
/*
* Single-precision log2 function.
*
- * Copyright (c) 2017-2018, Arm Limited.
+ * Copyright (c) 2017-2024, Arm Limited.
* SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
*/
#include <math.h>
#include <stdint.h>
#include "math_config.h"
+#include "test_defs.h"
+#include "test_sig.h"
/*
LOG2F_TABLE_BITS = 4
@@ -78,3 +80,10 @@ log2f (float x)
strong_alias (log2f, __log2f_finite)
hidden_alias (log2f, __ieee754_log2f)
#endif
+
+TEST_SIG (S, F, 1, log2, 0.01, 11.1)
+TEST_ULP (log2f, 0.26)
+TEST_ULP_NONNEAREST (log2f, 0.5)
+TEST_INTERVAL (log2f, 0, 0xffff0000, 10000)
+TEST_INTERVAL (log2f, 0x1p-4, 0x1p4, 50000)
+TEST_INTERVAL (log2f, 0, inf, 50000)