We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent8946267 commitbbe79a4Copy full SHA for bbe79a4
LookupTable/generate_cube.c
@@ -15,7 +15,13 @@
15
16
typedefuint32_t (*lut_fn_t)(uint32_t);
17
18
-// Function to generate a LUT dynamically
+/**
19
+ * @brief Generate a lookup table (LUT) for a given function.
20
+ *
21
+ * @param size Size of the LUT.
22
+ * @param func Function to compute LUT values.
23
+ * @return uint32_t* Pointer to the generated LUT or NULL on failure.
24
+ */
25
uint32_t*generate_lut(size_tsize,lut_fn_tfunc) {
26
uint32_t*table=malloc(size*sizeof(uint32_t));
27
if (table==NULL) {
@@ -28,7 +34,12 @@ uint32_t* generate_lut(size_t size, lut_fn_t func) {
28
34
returntable;
29
35
}
30
36
31
-// Example transformation function
37
38
+ * @brief Compute the cube of a number.
39
40
+ * @param x Input number.
41
+ * @return uint32_t Cube of the input number.
42
32
43
uint32_tcube(uint32_tx) {
33
44
returnx*x*x;
45