Skip to content

Commit 414718f

Browse files
authored
Update example.c
Signed-off-by: JaySoni1 <[email protected]>
1 parent 0012f7b commit 414718f

File tree

1 file changed

+12
-10
lines changed
  • lib/node_modules/@stdlib/number/float32/base/normalize/examples/c

1 file changed

+12
-10
lines changed

lib/node_modules/@stdlib/number/float32/base/normalize/examples/c/example.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@
2121
#include <inttypes.h>
2222

2323
int main( void ) {
24-
const float x[] = { 4.0f, 0.0f, -0.0f, 1.0f, -1.0f, 3.14f, -3.14f, 1.0e-38f, -1.0e-38f, 1.0f/0.0f, -1.0f/0.0f, 0.0f/0.0f };
25-
int32_t exp;
26-
float y;
27-
int i;
28-
29-
for ( i = 0; i < 12; i++ ) {
30-
stdlib_base_float32_normalize( x[ i ], &y, &exp );
31-
printf( "%f => y: %f, exp: %" PRId32 "\n", x[ i ], y, exp );
32-
}
33-
return 0;
24+
// Declare the array as const to address the lint warning
25+
const float x[] = { 4.0f, 0.0f, -0.0f, 1.0f, -1.0f, 3.14f, -3.14f, 1.0e-38f, -1.0e-38f, 1.0f/0.0f, -1.0f/0.0f, 0.0f/0.0f };
26+
int32_t exp;
27+
float y;
28+
int i;
29+
30+
for ( i = 0; i < 12; i++ ) {
31+
stdlib_base_float32_normalize( x[ i ], &y, &exp );
32+
printf( "%f => y: %f, exp: %" PRId32 "\n", x[ i ], y, exp );
33+
}
34+
35+
return 0;
3436
}

0 commit comments

Comments
 (0)