Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbbe79a4

Browse files
committed
Update generate_cube.c
1 parent8946267 commitbbe79a4

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

‎LookupTable/generate_cube.c‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515

1616
typedefuint32_t (*lut_fn_t)(uint32_t);
1717

18-
// Function to generate a LUT dynamically
18+
/**
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+
*/
1925
uint32_t*generate_lut(size_tsize,lut_fn_tfunc) {
2026
uint32_t*table=malloc(size*sizeof(uint32_t));
2127
if (table==NULL) {
@@ -28,7 +34,12 @@ uint32_t* generate_lut(size_t size, lut_fn_t func) {
2834
returntable;
2935
}
3036

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+
*/
3243
uint32_tcube(uint32_tx) {
3344
returnx*x*x;
3445
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp