From 3a0f7c5b8098164aa2b9d509f768feabf0d439a9 Mon Sep 17 00:00:00 2001 From: JaySoni1 Date: Tue, 25 Mar 2025 22:18:54 +0530 Subject: [PATCH 1/3] Update example.c Add const qualifier to x array Resolve style warning about variable declaration Signed-off-by: JaySoni1 --- .../base/normalize/examples/c/example.c | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/node_modules/@stdlib/number/float32/base/normalize/examples/c/example.c b/lib/node_modules/@stdlib/number/float32/base/normalize/examples/c/example.c index 48d510fc0816..c272d0470e2f 100644 --- a/lib/node_modules/@stdlib/number/float32/base/normalize/examples/c/example.c +++ b/lib/node_modules/@stdlib/number/float32/base/normalize/examples/c/example.c @@ -15,21 +15,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - #include "stdlib/number/float32/base/normalize.h" #include #include #include int main( void ) { - 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 }; - - int32_t exp; - float y; - int i; - for ( i = 0; i < 12; i++ ) { - stdlib_base_float32_normalize( x[ i ], &y, &exp ); - printf( "%f => y: %f, exp: %" PRId32 "\n", x[ i ], y, exp ); - } - + // Declare the array as const to address the lint warning + 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 }; + int32_t exp; + float y; + int i; + + for ( i = 0; i < 12; i++ ) { + stdlib_base_float32_normalize( x[ i ], &y, &exp ); + printf( "%f => y: %f, exp: %" PRId32 "\n", x[ i ], y, exp ); + } + + return 0; } From 0012f7b77a40c029ea312bb88705d25dac5d7663 Mon Sep 17 00:00:00 2001 From: JaySoni1 Date: Tue, 25 Mar 2025 22:28:44 +0530 Subject: [PATCH 2/3] Update example.c Signed-off-by: JaySoni1 --- .../base/normalize/examples/c/example.c | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/lib/node_modules/@stdlib/number/float32/base/normalize/examples/c/example.c b/lib/node_modules/@stdlib/number/float32/base/normalize/examples/c/example.c index c272d0470e2f..e5de8a5cee64 100644 --- a/lib/node_modules/@stdlib/number/float32/base/normalize/examples/c/example.c +++ b/lib/node_modules/@stdlib/number/float32/base/normalize/examples/c/example.c @@ -21,16 +21,14 @@ #include int main( void ) { - // Declare the array as const to address the lint warning - 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 }; - int32_t exp; - float y; - int i; - - for ( i = 0; i < 12; i++ ) { - stdlib_base_float32_normalize( x[ i ], &y, &exp ); - printf( "%f => y: %f, exp: %" PRId32 "\n", x[ i ], y, exp ); - } - - return 0; + 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 }; + int32_t exp; + float y; + int i; + + for ( i = 0; i < 12; i++ ) { + stdlib_base_float32_normalize( x[ i ], &y, &exp ); + printf( "%f => y: %f, exp: %" PRId32 "\n", x[ i ], y, exp ); + } + return 0; } From 414718f7cd44db00ec0ce0e20cc41289a5f8dfae Mon Sep 17 00:00:00 2001 From: JaySoni1 Date: Tue, 25 Mar 2025 22:35:05 +0530 Subject: [PATCH 3/3] Update example.c Signed-off-by: JaySoni1 --- .../base/normalize/examples/c/example.c | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/node_modules/@stdlib/number/float32/base/normalize/examples/c/example.c b/lib/node_modules/@stdlib/number/float32/base/normalize/examples/c/example.c index e5de8a5cee64..c272d0470e2f 100644 --- a/lib/node_modules/@stdlib/number/float32/base/normalize/examples/c/example.c +++ b/lib/node_modules/@stdlib/number/float32/base/normalize/examples/c/example.c @@ -21,14 +21,16 @@ #include int main( void ) { - 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 }; - int32_t exp; - float y; - int i; - - for ( i = 0; i < 12; i++ ) { - stdlib_base_float32_normalize( x[ i ], &y, &exp ); - printf( "%f => y: %f, exp: %" PRId32 "\n", x[ i ], y, exp ); - } - return 0; + // Declare the array as const to address the lint warning + 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 }; + int32_t exp; + float y; + int i; + + for ( i = 0; i < 12; i++ ) { + stdlib_base_float32_normalize( x[ i ], &y, &exp ); + printf( "%f => y: %f, exp: %" PRId32 "\n", x[ i ], y, exp ); + } + + return 0; }