diff --git a/base/assert/is-finite/examples/c/example.c b/base/assert/is-finite/examples/c/example.c index 8371fc8bc..511530f46 100644 --- a/base/assert/is-finite/examples/c/example.c +++ b/base/assert/is-finite/examples/c/example.c @@ -21,7 +21,7 @@ #include <stdbool.h> int main( void ) { - double x[] = { 3.14, -3.14, 1.0/0.0, 0.0/0.0 }; + const double x[] = { 3.14, -3.14, 1.0/0.0, 0.0/0.0 }; bool b; int i; diff --git a/base/assert/is-finitef/examples/c/example.c b/base/assert/is-finitef/examples/c/example.c index cd199454a..47e2d6b28 100644 --- a/base/assert/is-finitef/examples/c/example.c +++ b/base/assert/is-finitef/examples/c/example.c @@ -21,7 +21,7 @@ #include <stdbool.h> int main( void ) { - float x[] = { 3.14f, -3.14f, 1.0f/0.0f, 0.0f/0.0f }; + const float x[] = { 3.14f, -3.14f, 1.0f/0.0f, 0.0f/0.0f }; bool b; int i; diff --git a/base/assert/is-infinite/examples/c/example.c b/base/assert/is-infinite/examples/c/example.c index c85d21009..cf5c504c8 100644 --- a/base/assert/is-infinite/examples/c/example.c +++ b/base/assert/is-infinite/examples/c/example.c @@ -21,7 +21,7 @@ #include <stdbool.h> int main( void ) { - double x[] = { 3.14, -3.14, 1.0/0.0, 0.0/0.0 }; + const double x[] = { 3.14, -3.14, 1.0/0.0, 0.0/0.0 }; bool b; int i; diff --git a/base/assert/is-infinitef/examples/c/example.c b/base/assert/is-infinitef/examples/c/example.c index a04a3a684..f5196a765 100644 --- a/base/assert/is-infinitef/examples/c/example.c +++ b/base/assert/is-infinitef/examples/c/example.c @@ -21,7 +21,7 @@ #include <stdbool.h> int main( void ) { - float x[] = { 3.14f, -3.14f, 1.0f/0.0f, 0.0f/0.0f }; + const float x[] = { 3.14f, -3.14f, 1.0f/0.0f, 0.0f/0.0f }; bool b; int i; diff --git a/base/assert/is-nan/examples/c/example.c b/base/assert/is-nan/examples/c/example.c index 4f612c441..641ca958f 100644 --- a/base/assert/is-nan/examples/c/example.c +++ b/base/assert/is-nan/examples/c/example.c @@ -21,7 +21,7 @@ #include <stdbool.h> int main( void ) { - double x[] = { 3.14, -3.14, 0.0, 0.0/0.0 }; + const double x[] = { 3.14, -3.14, 0.0, 0.0/0.0 }; bool b; int i; diff --git a/base/assert/is-nanf/examples/c/example.c b/base/assert/is-nanf/examples/c/example.c index d048e0451..9f7be1ec4 100644 --- a/base/assert/is-nanf/examples/c/example.c +++ b/base/assert/is-nanf/examples/c/example.c @@ -21,7 +21,7 @@ #include <stdbool.h> int main( void ) { - float x[] = { 3.14, -3.14, 0.0, 0.0/0.0 }; + const float x[] = { 3.14f, -3.14f, 0.0f, 0.0f/0.0f }; bool b; int i; diff --git a/base/assert/is-negative-zero/examples/c/example.c b/base/assert/is-negative-zero/examples/c/example.c index 459301f8d..047dc5f2e 100644 --- a/base/assert/is-negative-zero/examples/c/example.c +++ b/base/assert/is-negative-zero/examples/c/example.c @@ -21,7 +21,7 @@ #include <stdbool.h> int main( void ) { - double x[] = { 0.0, -0.0, 3.14, 0.0/0.0 }; + const double x[] = { 0.0, -0.0, 3.14, 0.0/0.0 }; bool b; int i; diff --git a/base/assert/is-negative-zerof/examples/c/example.c b/base/assert/is-negative-zerof/examples/c/example.c index 9f48b6683..0854867e5 100644 --- a/base/assert/is-negative-zerof/examples/c/example.c +++ b/base/assert/is-negative-zerof/examples/c/example.c @@ -21,7 +21,7 @@ #include <stdbool.h> int main( void ) { - float x[] = { 0.0, -0.0, 3.14, 0.0/0.0 }; + const float x[] = { 0.0f, -0.0f, 3.14f, 0.0f/0.0f }; bool b; int i; diff --git a/base/assert/is-positive-zero/examples/c/example.c b/base/assert/is-positive-zero/examples/c/example.c index cca6cc371..fe97d58f2 100644 --- a/base/assert/is-positive-zero/examples/c/example.c +++ b/base/assert/is-positive-zero/examples/c/example.c @@ -21,7 +21,7 @@ #include <stdbool.h> int main( void ) { - double x[] = { 0.0, -0.0, 3.14, 0.0/0.0 }; + const double x[] = { 0.0, -0.0, 3.14, 0.0/0.0 }; bool b; int i; diff --git a/base/assert/is-positive-zerof/examples/c/example.c b/base/assert/is-positive-zerof/examples/c/example.c index 6718aebdf..bfe7771f4 100644 --- a/base/assert/is-positive-zerof/examples/c/example.c +++ b/base/assert/is-positive-zerof/examples/c/example.c @@ -21,7 +21,7 @@ #include <stdbool.h> int main( void ) { - float x[] = { 0.0, -0.0, 3.14, 0.0/0.0 }; + const float x[] = { 0.0f, -0.0f, 3.14f, 0.0f/0.0f }; bool b; int i; diff --git a/base/ops/add/examples/c/example.c b/base/ops/add/examples/c/example.c index 5e9f0979e..0c1e19687 100644 --- a/base/ops/add/examples/c/example.c +++ b/base/ops/add/examples/c/example.c @@ -20,8 +20,8 @@ #include <stdio.h> int main( void ) { - double x[] = { 3.14, -3.14, 0.0, 0.0/0.0 }; - double y[] = { 3.14, -3.14, -0.0, 0.0/0.0 }; + const double x[] = { 3.14, -3.14, 0.0, 0.0/0.0 }; + const double y[] = { 3.14, -3.14, -0.0, 0.0/0.0 }; double z; int i; diff --git a/base/ops/addf/examples/c/example.c b/base/ops/addf/examples/c/example.c index a40e72e5e..167e93e08 100644 --- a/base/ops/addf/examples/c/example.c +++ b/base/ops/addf/examples/c/example.c @@ -20,8 +20,8 @@ #include <stdio.h> int main( void ) { - float x[] = { 3.14f, -3.14f, 0.0f, 0.0f/0.0f }; - float y[] = { 3.14f, -3.14f, -0.0f, 0.0f/0.0f }; + const float x[] = { 3.14f, -3.14f, 0.0f, 0.0f/0.0f }; + const float y[] = { 3.14f, -3.14f, -0.0f, 0.0f/0.0f }; float z; int i; diff --git a/base/ops/cadd/examples/c/example.c b/base/ops/cadd/examples/c/example.c index b176543a8..f1e4e3b82 100644 --- a/base/ops/cadd/examples/c/example.c +++ b/base/ops/cadd/examples/c/example.c @@ -22,7 +22,7 @@ #include <stdio.h> int main( void ) { - stdlib_complex128_t x[] = { + const stdlib_complex128_t x[] = { stdlib_complex128( 3.14, 1.5 ), stdlib_complex128( -3.14, 1.5 ), stdlib_complex128( 0.0, -0.0 ), diff --git a/base/ops/caddf/examples/c/example.c b/base/ops/caddf/examples/c/example.c index fefa31564..028aec188 100644 --- a/base/ops/caddf/examples/c/example.c +++ b/base/ops/caddf/examples/c/example.c @@ -22,7 +22,7 @@ #include <stdio.h> int main( void ) { - stdlib_complex64_t x[] = { + const stdlib_complex64_t x[] = { stdlib_complex64( 3.14f, 1.5f ), stdlib_complex64( -3.14f, 1.5f ), stdlib_complex64( 0.0f, -0.0f ), diff --git a/base/ops/cdiv/README.md b/base/ops/cdiv/README.md index e26d4e7f1..cf7419c92 100644 --- a/base/ops/cdiv/README.md +++ b/base/ops/cdiv/README.md @@ -177,7 +177,7 @@ stdlib_complex128_t stdlib_base_cdiv( const stdlib_complex128_t z1, const stdlib #include "stdlib/complex/reim.h" #include <stdio.h> -int main() { +int main( void ) { const stdlib_complex128_t x[] = { stdlib_complex128( 3.14, 1.5 ), stdlib_complex128( -3.14, 1.5 ), diff --git a/base/ops/cdiv/examples/c/example.c b/base/ops/cdiv/examples/c/example.c index d452c7317..c8d13d075 100644 --- a/base/ops/cdiv/examples/c/example.c +++ b/base/ops/cdiv/examples/c/example.c @@ -21,7 +21,7 @@ #include "stdlib/complex/reim.h" #include <stdio.h> -int main() { +int main( void ) { const stdlib_complex128_t x[] = { stdlib_complex128( 3.14, 1.5 ), stdlib_complex128( -3.14, 1.5 ), diff --git a/base/ops/cmulf/examples/c/example.c b/base/ops/cmulf/examples/c/example.c index 40cc7df60..a7bb2f001 100644 --- a/base/ops/cmulf/examples/c/example.c +++ b/base/ops/cmulf/examples/c/example.c @@ -22,7 +22,7 @@ #include <stdio.h> int main( void ) { - stdlib_complex64_t x[] = { + const stdlib_complex64_t x[] = { stdlib_complex64( 3.14f, 1.5f ), stdlib_complex64( -3.14f, 1.5f ), stdlib_complex64( 0.0f, -0.0f ), diff --git a/base/ops/csub/examples/c/example.c b/base/ops/csub/examples/c/example.c index 3efe9eb7e..e382ffc10 100644 --- a/base/ops/csub/examples/c/example.c +++ b/base/ops/csub/examples/c/example.c @@ -22,7 +22,7 @@ #include <stdio.h> int main( void ) { - stdlib_complex128_t x[] = { + const stdlib_complex128_t x[] = { stdlib_complex128( 3.14, 1.5 ), stdlib_complex128( -3.14, 1.5 ), stdlib_complex128( 0.0, -0.0 ), diff --git a/base/ops/csubf/examples/c/example.c b/base/ops/csubf/examples/c/example.c index 23651b12f..eef19d234 100644 --- a/base/ops/csubf/examples/c/example.c +++ b/base/ops/csubf/examples/c/example.c @@ -22,7 +22,7 @@ #include <stdio.h> int main( void ) { - stdlib_complex64_t x[] = { + const stdlib_complex64_t x[] = { stdlib_complex64( 3.14f, 1.5f ), stdlib_complex64( -3.14f, 1.5f ), stdlib_complex64( 0.0f, -0.0f ), diff --git a/base/ops/mul/examples/c/example.c b/base/ops/mul/examples/c/example.c index bb97bfab5..669ea50f1 100644 --- a/base/ops/mul/examples/c/example.c +++ b/base/ops/mul/examples/c/example.c @@ -20,8 +20,8 @@ #include <stdio.h> int main( void ) { - double x[] = { 3.14, -3.14, 0.0, 0.0/0.0 }; - double y[] = { 3.14, -3.14, -0.0, 0.0/0.0 }; + const double x[] = { 3.14, -3.14, 0.0, 0.0/0.0 }; + const double y[] = { 3.14, -3.14, -0.0, 0.0/0.0 }; double z; int i; diff --git a/base/ops/mulf/examples/c/example.c b/base/ops/mulf/examples/c/example.c index b61bb9fab..5c6286ee3 100644 --- a/base/ops/mulf/examples/c/example.c +++ b/base/ops/mulf/examples/c/example.c @@ -20,8 +20,8 @@ #include <stdio.h> int main( void ) { - float x[] = { 3.14f, -3.14f, 0.0f, 0.0f/0.0f }; - float y[] = { 3.14f, -3.14f, -0.0f, 0.0f/0.0f }; + const float x[] = { 3.14f, -3.14f, 0.0f, 0.0f/0.0f }; + const float y[] = { 3.14f, -3.14f, -0.0f, 0.0f/0.0f }; float z; int i; diff --git a/base/ops/sub/examples/c/example.c b/base/ops/sub/examples/c/example.c index 77fe13a52..78accd825 100644 --- a/base/ops/sub/examples/c/example.c +++ b/base/ops/sub/examples/c/example.c @@ -20,8 +20,8 @@ #include <stdio.h> int main( void ) { - double x[] = { 3.14, -3.14, 0.0, 0.0/0.0 }; - double y[] = { 3.14, -3.14, -0.0, 0.0/0.0 }; + const double x[] = { 3.14, -3.14, 0.0, 0.0/0.0 }; + const double y[] = { 3.14, -3.14, -0.0, 0.0/0.0 }; double z; int i; diff --git a/base/ops/subf/examples/c/example.c b/base/ops/subf/examples/c/example.c index e9604440c..d5d7e83e1 100644 --- a/base/ops/subf/examples/c/example.c +++ b/base/ops/subf/examples/c/example.c @@ -20,8 +20,8 @@ #include <stdio.h> int main( void ) { - float x[] = { 3.14f, -3.14f, 0.0f, 0.0f/0.0f }; - float y[] = { 3.14f, -3.14f, -0.0f, 0.0f/0.0f }; + const float x[] = { 3.14f, -3.14f, 0.0f, 0.0f/0.0f }; + const float y[] = { 3.14f, -3.14f, -0.0f, 0.0f/0.0f }; float z; int i; diff --git a/strided/special/dabs/README.md b/strided/special/dabs/README.md index b9d3788b4..35310a0a6 100644 --- a/strided/special/dabs/README.md +++ b/strided/special/dabs/README.md @@ -200,10 +200,10 @@ Computes the absolute value for each element in a double-precision floating-poin ```c #include <stdint.h> -double X[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; +const double X[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_dabs( N, X, 2, Y, 2 ); ``` @@ -245,17 +245,17 @@ void stdlib_strided_dabs( const int64_t N, const double *X, const int64_t stride int main( void ) { // Create an input strided array: - double X[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; + const double X[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; // Create an output strided array: double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the absolute value element-wise: stdlib_strided_dabs( N, X, strideX, Y, strideY ); diff --git a/strided/special/dabs/examples/c/example.c b/strided/special/dabs/examples/c/example.c index 63d93c5e7..89568c71d 100644 --- a/strided/special/dabs/examples/c/example.c +++ b/strided/special/dabs/examples/c/example.c @@ -22,17 +22,17 @@ int main( void ) { // Create an input strided array: - double x[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; + const double x[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; // Create an output strided array: double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the absolute value element-wise: stdlib_strided_dabs( N, x, strideX, y, strideY ); diff --git a/strided/special/dabs/src/dabs.c b/strided/special/dabs/src/dabs.c index a454eba66..df7119937 100644 --- a/strided/special/dabs/src/dabs.c +++ b/strided/special/dabs/src/dabs.c @@ -34,17 +34,17 @@ * #include <stdint.h> * * // Create an input strided array: -* double x[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; +* const double x[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; * * // Create an output strided array: * double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideY = 2; * * // Compute the absolute value element-wise: * stdlib_strided_dabs( N, x, strideX, y, strideY ); diff --git a/strided/special/dabs2/README.md b/strided/special/dabs2/README.md index 9cdf73b1e..68becc6e4 100644 --- a/strided/special/dabs2/README.md +++ b/strided/special/dabs2/README.md @@ -200,10 +200,10 @@ Computes the squared absolute value for each element in a double-precision float ```c #include <stdint.h> -double X[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; +const double X[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_dabs2( N, X, 2, Y, 2 ); ``` @@ -245,17 +245,17 @@ void stdlib_strided_dabs2( const int64_t N, const double *X, const int64_t strid int main( void ) { // Create an input strided array: - double X[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; + const double X[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; // Create an output strided array: double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the squared absolute value element-wise: stdlib_strided_dabs2( N, X, strideX, Y, strideY ); diff --git a/strided/special/dabs2/examples/c/example.c b/strided/special/dabs2/examples/c/example.c index f36498368..0ef5ec7e3 100644 --- a/strided/special/dabs2/examples/c/example.c +++ b/strided/special/dabs2/examples/c/example.c @@ -22,17 +22,17 @@ int main( void ) { // Create an input strided array: - double x[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; + const double x[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; // Create an output strided array: double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the squared absolute value element-wise: stdlib_strided_dabs2( N, x, strideX, y, strideY ); diff --git a/strided/special/dabs2/src/dabs2.c b/strided/special/dabs2/src/dabs2.c index 3920e2f50..89d98461d 100644 --- a/strided/special/dabs2/src/dabs2.c +++ b/strided/special/dabs2/src/dabs2.c @@ -34,17 +34,17 @@ * #include <stdint.h> * * // Create an input strided array: -* double x[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; +* const double x[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; * * // Create an output strided array: * double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideY = 2; * * // Compute the squared absolute value element-wise: * stdlib_strided_dabs2( N, x, strideX, y, strideY ); diff --git a/strided/special/dcbrt/README.md b/strided/special/dcbrt/README.md index 2b2c7f836..ced971342 100644 --- a/strided/special/dcbrt/README.md +++ b/strided/special/dcbrt/README.md @@ -190,10 +190,10 @@ Computes the cube root of each element in a double-precision floating-point stri ```c #include <stdint.h> -double X[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; +const double X[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_dcbrt( N, X, 2, Y, 2 ); ``` @@ -235,17 +235,17 @@ void stdlib_strided_dcbrt( const int64_t N, const double *X, const int64_t strid int main( void ) { // Create an input strided array: - double X[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; + const double X[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; // Create an output strided array: double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dcbrt( N, X, strideX, Y, strideY ); diff --git a/strided/special/dcbrt/examples/c/example.c b/strided/special/dcbrt/examples/c/example.c index b03968d29..1fac190ac 100644 --- a/strided/special/dcbrt/examples/c/example.c +++ b/strided/special/dcbrt/examples/c/example.c @@ -22,17 +22,17 @@ int main( void ) { // Create an input strided array: - double x[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; + const double x[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; // Create an output strided array: double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dcbrt( N, x, strideX, y, strideY ); diff --git a/strided/special/dcbrt/src/dcbrt.c b/strided/special/dcbrt/src/dcbrt.c index 70090cfb6..25c233669 100644 --- a/strided/special/dcbrt/src/dcbrt.c +++ b/strided/special/dcbrt/src/dcbrt.c @@ -34,17 +34,17 @@ * #include <stdint.h> * * // Create an input strided array: -* double x[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; +* const double x[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; * * // Create an output strided array: * double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_dcbrt( N, x, strideX, y, strideY ); diff --git a/strided/special/dceil/README.md b/strided/special/dceil/README.md index 6fc4a4397..6840b8b9a 100644 --- a/strided/special/dceil/README.md +++ b/strided/special/dceil/README.md @@ -190,10 +190,10 @@ Rounds each element in a double-precision floating-point strided array `X` towar ```c #include <stdint.h> -double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +const double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_dceil( N, X, 2, Y, 2 ); ``` @@ -235,17 +235,17 @@ void stdlib_strided_dceil( const int64_t N, const double *X, const int64_t strid int main( void ) { // Create an input strided array: - double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create an output strided array: double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dceil( N, X, strideX, Y, strideY ); diff --git a/strided/special/dceil/examples/c/example.c b/strided/special/dceil/examples/c/example.c index 3ef8cc2f8..5a6cc5efd 100644 --- a/strided/special/dceil/examples/c/example.c +++ b/strided/special/dceil/examples/c/example.c @@ -22,17 +22,17 @@ int main( void ) { // Create an input strided array: - double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create an output strided array: double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dceil( N, x, strideX, y, strideY ); diff --git a/strided/special/dceil/src/dceil.c b/strided/special/dceil/src/dceil.c index 78df8d027..6c66f70ba 100644 --- a/strided/special/dceil/src/dceil.c +++ b/strided/special/dceil/src/dceil.c @@ -34,17 +34,17 @@ * #include <stdint.h> * * // Create an input strided array: -* double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +* const double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; * * // Create an output strided array: * double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_dceil( N, x, strideX, y, strideY ); diff --git a/strided/special/ddeg2rad/README.md b/strided/special/ddeg2rad/README.md index b009dff31..3be704ed9 100644 --- a/strided/special/ddeg2rad/README.md +++ b/strided/special/ddeg2rad/README.md @@ -190,10 +190,10 @@ Converts each element in a double-precision floating-point strided array `x` fro ```c #include <stdint.h> -double X[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; +const double X[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_ddeg2rad( N, X, 2, Y, 2 ); ``` @@ -235,17 +235,17 @@ void stdlib_strided_ddeg2rad( const int64_t N, const double *X, const int64_t st int main( void ) { // Create an input strided array: - double X[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; + const double X[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; // Create an output strided array: double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_ddeg2rad( N, X, strideX, Y, strideY ); diff --git a/strided/special/ddeg2rad/examples/c/example.c b/strided/special/ddeg2rad/examples/c/example.c index 2b6242f90..ab041f089 100644 --- a/strided/special/ddeg2rad/examples/c/example.c +++ b/strided/special/ddeg2rad/examples/c/example.c @@ -22,17 +22,17 @@ int main( void ) { // Create an input strided array: - double x[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; + const double x[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; // Create an output strided array: double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_ddeg2rad( N, x, strideX, y, strideY ); diff --git a/strided/special/ddeg2rad/src/ddeg2rad.c b/strided/special/ddeg2rad/src/ddeg2rad.c index b2e0200b1..bc78eecc7 100644 --- a/strided/special/ddeg2rad/src/ddeg2rad.c +++ b/strided/special/ddeg2rad/src/ddeg2rad.c @@ -34,17 +34,17 @@ * #include <stdint.h> * * // Create an input strided array: -* double x[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; +* const double x[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; * * // Create an output strided array: * double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_ddeg2rad( N, x, strideX, y, strideY ); diff --git a/strided/special/dfloor/README.md b/strided/special/dfloor/README.md index dd21bd80b..a9b5dec30 100644 --- a/strided/special/dfloor/README.md +++ b/strided/special/dfloor/README.md @@ -190,10 +190,10 @@ Rounds each element in a double-precision floating-point strided array `X` towar ```c #include <stdint.h> -double X[] = { -1.5, 2.3, -3.9, 4.2, -5.0, -6.0, 7.9, -8.1 }; +const double X[] = { -1.5, 2.3, -3.9, 4.2, -5.0, -6.0, 7.9, -8.1 }; double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_dfloor( N, X, 2, Y, 2 ); ``` @@ -235,17 +235,17 @@ void stdlib_strided_dfloor( const int64_t N, const double *X, const int64_t stri int main( void ) { // Create an input strided array: - double X[] = { -1.5, 2.3, -3.9, 4.2, -5.0, -6.0, 7.9, -8.1 }; + const double X[] = { -1.5, 2.3, -3.9, 4.2, -5.0, -6.0, 7.9, -8.1 }; // Create an output strided array: double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dfloor( N, X, strideX, Y, strideY ); diff --git a/strided/special/dfloor/examples/c/example.c b/strided/special/dfloor/examples/c/example.c index 1cd2e61a6..2e445734b 100644 --- a/strided/special/dfloor/examples/c/example.c +++ b/strided/special/dfloor/examples/c/example.c @@ -22,17 +22,17 @@ int main( void ) { // Create an input strided array: - double x[] = { -1.5, 2.3, -3.9, 4.2, -5.0, -6.0, 7.9, -8.1 }; + const double x[] = { -1.5, 2.3, -3.9, 4.2, -5.0, -6.0, 7.9, -8.1 }; // Create an output strided array: double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dfloor( N, x, strideX, y, strideY ); diff --git a/strided/special/dfloor/src/dfloor.c b/strided/special/dfloor/src/dfloor.c index 84e6de801..36943dcc5 100644 --- a/strided/special/dfloor/src/dfloor.c +++ b/strided/special/dfloor/src/dfloor.c @@ -34,17 +34,17 @@ * #include <stdint.h> * * // Create an input strided array: -* double x[] = { -1.5, 2.3, -3.9, 4.2, -5.0, -6.0, 7.9, -8.1 }; +* const double x[] = { -1.5, 2.3, -3.9, 4.2, -5.0, -6.0, 7.9, -8.1 }; * * // Create an output strided array: * double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_dfloor( N, x, strideX, y, strideY ); diff --git a/strided/special/dinv/README.md b/strided/special/dinv/README.md index 5968a5b2a..a04e60c76 100644 --- a/strided/special/dinv/README.md +++ b/strided/special/dinv/README.md @@ -190,10 +190,10 @@ Computes the multiplicative inverse for each element in a double-precision float ```c #include <stdint.h> -double X[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; +const double X[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_dinv( N, X, 2, Y, 2 ); ``` @@ -235,17 +235,17 @@ void stdlib_strided_dinv( const int64_t N, const double *X, const int64_t stride int main( void ) { // Create an input strided array: - double X[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; + const double X[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; // Create an output strided array: double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dinv( N, X, strideX, Y, strideY ); diff --git a/strided/special/dinv/examples/c/example.c b/strided/special/dinv/examples/c/example.c index ba644fd47..92433c711 100644 --- a/strided/special/dinv/examples/c/example.c +++ b/strided/special/dinv/examples/c/example.c @@ -22,17 +22,17 @@ int main( void ) { // Create an input strided array: - double x[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; + const double x[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; // Create an output strided array: double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dinv( N, x, strideX, y, strideY ); diff --git a/strided/special/dinv/src/dinv.c b/strided/special/dinv/src/dinv.c index d05869df8..89fbd21b8 100644 --- a/strided/special/dinv/src/dinv.c +++ b/strided/special/dinv/src/dinv.c @@ -34,17 +34,17 @@ * #include <stdint.h> * * // Create an input strided array: -* double x[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; +* const double x[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; * * // Create an output strided array: * double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_dinv( N, x, strideX, y, strideY ); diff --git a/strided/special/dmskabs/README.md b/strided/special/dmskabs/README.md index 142599987..a08950f2d 100644 --- a/strided/special/dmskabs/README.md +++ b/strided/special/dmskabs/README.md @@ -210,11 +210,11 @@ Computes the [absolute value][@stdlib/math/base/special/abs] for each element in ```c #include <stdint.h> -double X[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; -uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +const double X[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; +const uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_dmskabs( N, X, 2, Mask, 2, Y, 2 ); ``` @@ -258,21 +258,21 @@ void stdlib_strided_dmskabs( const int64_t N, const double *X, const int64_t str int main( void ) { // Create an input strided array: - double X[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; + const double X[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; // Create a mask strided array: - uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dmskabs( N, X, strideX, M, strideM, Y, strideY ); diff --git a/strided/special/dmskabs/examples/c/example.c b/strided/special/dmskabs/examples/c/example.c index 927955676..fa9c3d382 100644 --- a/strided/special/dmskabs/examples/c/example.c +++ b/strided/special/dmskabs/examples/c/example.c @@ -22,21 +22,21 @@ int main( void ) { // Create an input strided array: - double x[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; + const double x[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; // Create a mask strided array: - uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dmskabs( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/dmskabs/src/dmskabs.c b/strided/special/dmskabs/src/dmskabs.c index eacde0775..03bc9fa2e 100644 --- a/strided/special/dmskabs/src/dmskabs.c +++ b/strided/special/dmskabs/src/dmskabs.c @@ -36,21 +36,21 @@ * include <stdint.h> * * // Create an input strided array: -* double x[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; +* const double x[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; * * // Create a mask strided array: -* uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +* const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; * * // Create an output strided array: * double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideM = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideM = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_dmskabs( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/dmskabs2/README.md b/strided/special/dmskabs2/README.md index b8f44081a..0e4c16c16 100644 --- a/strided/special/dmskabs2/README.md +++ b/strided/special/dmskabs2/README.md @@ -210,11 +210,11 @@ Computes the [squared absolute value][@stdlib/math/base/special/abs2] for each e ```c #include <stdint.h> -double X[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; -uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +const double X[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; +const uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_dmskabs2( N, X, 2, Mask, 2, Y, 2 ); ``` @@ -258,21 +258,21 @@ void stdlib_strided_dmskabs2( const int64_t N, const double *X, const int64_t st int main( void ) { // Create an input strided array: - double X[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; + const double X[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; // Create a mask strided array: - uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dmskabs2( N, X, strideX, M, strideM, Y, strideY ); diff --git a/strided/special/dmskabs2/examples/c/example.c b/strided/special/dmskabs2/examples/c/example.c index a0c7bdd6d..022eb57b7 100644 --- a/strided/special/dmskabs2/examples/c/example.c +++ b/strided/special/dmskabs2/examples/c/example.c @@ -22,21 +22,21 @@ int main( void ) { // Create an input strided array: - double x[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; + const double x[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; // Create a mask strided array: - uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dmskabs2( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/dmskabs2/src/dmskabs2.c b/strided/special/dmskabs2/src/dmskabs2.c index 9c6cdd76f..b52bb95bf 100644 --- a/strided/special/dmskabs2/src/dmskabs2.c +++ b/strided/special/dmskabs2/src/dmskabs2.c @@ -36,21 +36,21 @@ * include <stdint.h> * * // Create an input strided array: -* double x[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; +* const double x[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; * * // Create a mask strided array: -* uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +* const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; * * // Create an output strided array: * double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideM = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideM = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_dmskabs2( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/dmskcbrt/README.md b/strided/special/dmskcbrt/README.md index 51a58df7b..d4f535a26 100644 --- a/strided/special/dmskcbrt/README.md +++ b/strided/special/dmskcbrt/README.md @@ -210,11 +210,11 @@ Computes the [cube root][@stdlib/math/base/special/cbrt] for each element in a d ```c #include <stdint.h> -double X[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; -uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +const double X[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; +const uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_dmskcbrt( N, X, 2, Mask, 2, Y, 2 ); ``` @@ -258,21 +258,21 @@ void stdlib_strided_dmskcbrt( const int64_t N, const double *X, const int64_t st int main( void ) { // Create an input strided array: - double X[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; + const double X[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; // Create a mask strided array: - uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dmskcbrt( N, X, strideX, M, strideM, Y, strideY ); diff --git a/strided/special/dmskcbrt/examples/c/example.c b/strided/special/dmskcbrt/examples/c/example.c index 00594f463..ed9c1111f 100644 --- a/strided/special/dmskcbrt/examples/c/example.c +++ b/strided/special/dmskcbrt/examples/c/example.c @@ -22,21 +22,21 @@ int main( void ) { // Create an input strided array: - double x[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; + const double x[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; // Create a mask strided array: - uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dmskcbrt( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/dmskcbrt/src/dmskcbrt.c b/strided/special/dmskcbrt/src/dmskcbrt.c index c3a4f7ce8..ae5d46e4c 100644 --- a/strided/special/dmskcbrt/src/dmskcbrt.c +++ b/strided/special/dmskcbrt/src/dmskcbrt.c @@ -36,21 +36,21 @@ * include <stdint.h> * * // Create an input strided array: -* double x[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; +* const double x[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; * * // Create a mask strided array: -* uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +* const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; * * // Create an output strided array: * double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideM = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideM = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_dmskcbrt( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/dmskceil/README.md b/strided/special/dmskceil/README.md index 1d46e39f4..9c94f289a 100644 --- a/strided/special/dmskceil/README.md +++ b/strided/special/dmskceil/README.md @@ -210,11 +210,11 @@ Rounds each element in a double-precision floating-point strided array `X` towar ```c #include <stdint.h> -double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; -uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +const double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +const uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_dmskceil( N, X, 2, Mask, 2, Y, 2 ); ``` @@ -258,21 +258,21 @@ void stdlib_strided_dmskceil( const int64_t N, const double *X, const int64_t st int main( void ) { // Create an input strided array: - double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create a mask strided array: - uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dmskceil( N, X, strideX, M, strideM, Y, strideY ); diff --git a/strided/special/dmskceil/examples/c/example.c b/strided/special/dmskceil/examples/c/example.c index 1a1d895d7..739d3caff 100644 --- a/strided/special/dmskceil/examples/c/example.c +++ b/strided/special/dmskceil/examples/c/example.c @@ -22,21 +22,21 @@ int main( void ) { // Create an input strided array: - double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create a mask strided array: - uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dmskceil( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/dmskceil/src/dmskceil.c b/strided/special/dmskceil/src/dmskceil.c index 5a8d68fb3..a2295095e 100644 --- a/strided/special/dmskceil/src/dmskceil.c +++ b/strided/special/dmskceil/src/dmskceil.c @@ -36,21 +36,21 @@ * include <stdint.h> * * // Create an input strided array: -* double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +* const double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; * * // Create a mask strided array: -* uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +* const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; * * // Create an output strided array: * double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideM = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideM = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_dmskceil( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/dmskdeg2rad/README.md b/strided/special/dmskdeg2rad/README.md index f22bf072a..8b9dc722f 100644 --- a/strided/special/dmskdeg2rad/README.md +++ b/strided/special/dmskdeg2rad/README.md @@ -210,11 +210,11 @@ Converts each element in a double-precision floating-point strided array `X` fro ```c #include <stdint.h> -double X[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; -uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +const double X[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; +const uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_dmskdeg2rad( N, X, 2, Mask, 2, Y, 2 ); ``` @@ -258,21 +258,21 @@ void stdlib_strided_dmskdeg2rad( const int64_t N, const double *X, const int64_t int main( void ) { // Create an input strided array: - double X[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; + const double X[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; // Create a mask strided array: - uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dmskdeg2rad( N, X, strideX, M, strideM, Y, strideY ); diff --git a/strided/special/dmskdeg2rad/examples/c/example.c b/strided/special/dmskdeg2rad/examples/c/example.c index 3aa0fc7fa..e4875752c 100644 --- a/strided/special/dmskdeg2rad/examples/c/example.c +++ b/strided/special/dmskdeg2rad/examples/c/example.c @@ -22,21 +22,21 @@ int main( void ) { // Create an input strided array: - double x[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; + const double x[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; // Create a mask strided array: - uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dmskdeg2rad( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/dmskdeg2rad/src/dmskdeg2rad.c b/strided/special/dmskdeg2rad/src/dmskdeg2rad.c index 11fc5f68a..19942526e 100644 --- a/strided/special/dmskdeg2rad/src/dmskdeg2rad.c +++ b/strided/special/dmskdeg2rad/src/dmskdeg2rad.c @@ -36,21 +36,21 @@ * include <stdint.h> * * // Create an input strided array: -* double x[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; +* const double x[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; * * // Create a mask strided array: -* uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +* const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; * * // Create an output strided array: * double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideM = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideM = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_dmskdeg2rad( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/dmskfloor/README.md b/strided/special/dmskfloor/README.md index 1e59207a8..c244bb3ef 100644 --- a/strided/special/dmskfloor/README.md +++ b/strided/special/dmskfloor/README.md @@ -210,11 +210,11 @@ Rounds each element in a double-precision floating-point strided array `X` towar ```c #include <stdint.h> -double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; -uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +const double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +const uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_dmskfloor( N, X, 2, Mask, 2, Y, 2 ); ``` @@ -258,21 +258,21 @@ void stdlib_strided_dmskfloor( const int64_t N, const double *X, const int64_t s int main( void ) { // Create an input strided array: - double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create a mask strided array: - uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dmskfloor( N, X, strideX, M, strideM, Y, strideY ); diff --git a/strided/special/dmskfloor/examples/c/example.c b/strided/special/dmskfloor/examples/c/example.c index 56aa4706b..bfb5b58d1 100644 --- a/strided/special/dmskfloor/examples/c/example.c +++ b/strided/special/dmskfloor/examples/c/example.c @@ -22,21 +22,21 @@ int main( void ) { // Create an input strided array: - double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create a mask strided array: - uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dmskfloor( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/dmskfloor/src/dmskfloor.c b/strided/special/dmskfloor/src/dmskfloor.c index 8daff0b45..4b34f4c67 100644 --- a/strided/special/dmskfloor/src/dmskfloor.c +++ b/strided/special/dmskfloor/src/dmskfloor.c @@ -36,21 +36,21 @@ * include <stdint.h> * * // Create an input strided array: -* double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +* const double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; * * // Create a mask strided array: -* uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +* const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; * * // Create an output strided array: * double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideM = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideM = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_dmskfloor( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/dmskinv/README.md b/strided/special/dmskinv/README.md index 60eb6b363..baaffb51c 100644 --- a/strided/special/dmskinv/README.md +++ b/strided/special/dmskinv/README.md @@ -210,11 +210,11 @@ Computes the [multiplicative inverse][@stdlib/math/base/special/inv] for each el ```c #include <stdint.h> -double X[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; -uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +const double X[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; +const uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_dmskinv( N, X, 2, Mask, 2, Y, 2 ); ``` @@ -258,21 +258,21 @@ void stdlib_strided_dmskinv( const int64_t N, const double *X, const int64_t str int main( void ) { // Create an input strided array: - double X[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; + const double X[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; // Create a mask strided array: - uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dmskinv( N, X, strideX, M, strideM, Y, strideY ); diff --git a/strided/special/dmskinv/examples/c/example.c b/strided/special/dmskinv/examples/c/example.c index cc5de9dd8..2ed2b6702 100644 --- a/strided/special/dmskinv/examples/c/example.c +++ b/strided/special/dmskinv/examples/c/example.c @@ -22,21 +22,21 @@ int main( void ) { // Create an input strided array: - double x[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; + const double x[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; // Create a mask strided array: - uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dmskinv( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/dmskinv/src/dmskinv.c b/strided/special/dmskinv/src/dmskinv.c index 4f8113c9a..df07ad45a 100644 --- a/strided/special/dmskinv/src/dmskinv.c +++ b/strided/special/dmskinv/src/dmskinv.c @@ -36,21 +36,21 @@ * include <stdint.h> * * // Create an input strided array: -* double x[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; +* const double x[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; * * // Create a mask strided array: -* uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +* const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; * * // Create an output strided array: * double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideM = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideM = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_dmskinv( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/dmskramp/README.md b/strided/special/dmskramp/README.md index 83d9c1e65..436488812 100644 --- a/strided/special/dmskramp/README.md +++ b/strided/special/dmskramp/README.md @@ -210,11 +210,11 @@ Evaluates the [ramp function][@stdlib/math/base/special/ramp] for each element i ```c #include <stdint.h> -double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; -uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +const double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +const uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_dmskramp( N, X, 2, Mask, 2, Y, 2 ); ``` @@ -258,21 +258,21 @@ void stdlib_strided_dmskramp( const int64_t N, const double *X, const int64_t st int main( void ) { // Create an input strided array: - double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create a mask strided array: - uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dmskramp( N, X, strideX, M, strideM, Y, strideY ); diff --git a/strided/special/dmskramp/examples/c/example.c b/strided/special/dmskramp/examples/c/example.c index 3c5dd32db..240d0ae42 100644 --- a/strided/special/dmskramp/examples/c/example.c +++ b/strided/special/dmskramp/examples/c/example.c @@ -22,21 +22,21 @@ int main( void ) { // Create an input strided array: - double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create a mask strided array: - uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dmskramp( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/dmskramp/src/dmskramp.c b/strided/special/dmskramp/src/dmskramp.c index 6995e1464..8691f0e91 100644 --- a/strided/special/dmskramp/src/dmskramp.c +++ b/strided/special/dmskramp/src/dmskramp.c @@ -36,21 +36,21 @@ * include <stdint.h> * * // Create an input strided array: -* double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +* const double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; * * // Create a mask strided array: -* uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +* const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; * * // Create an output strided array: * double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideM = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideM = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_dmskramp( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/dmskrsqrt/README.md b/strided/special/dmskrsqrt/README.md index 3a7bacca1..dae9e74c3 100644 --- a/strided/special/dmskrsqrt/README.md +++ b/strided/special/dmskrsqrt/README.md @@ -210,11 +210,11 @@ Computes the [reciprocal square root][@stdlib/math/base/special/rsqrt] for each ```c #include <stdint.h> -double X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; -uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +const double X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; +const uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_dmskrsqrt( N, X, 2, Mask, 2, Y, 2 ); ``` @@ -258,21 +258,21 @@ void stdlib_strided_dmskrsqrt( const int64_t N, const double *X, const int64_t s int main( void ) { // Create an input strided array: - double X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; + const double X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; // Create a mask strided array: - uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dmskrsqrt( N, X, strideX, M, strideM, Y, strideY ); diff --git a/strided/special/dmskrsqrt/examples/c/example.c b/strided/special/dmskrsqrt/examples/c/example.c index f4a87e39c..1fd5e6790 100644 --- a/strided/special/dmskrsqrt/examples/c/example.c +++ b/strided/special/dmskrsqrt/examples/c/example.c @@ -22,21 +22,21 @@ int main( void ) { // Create an input strided array: - double x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; + const double x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; // Create a mask strided array: - uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dmskrsqrt( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/dmskrsqrt/src/dmskrsqrt.c b/strided/special/dmskrsqrt/src/dmskrsqrt.c index a5821c136..0ed958519 100644 --- a/strided/special/dmskrsqrt/src/dmskrsqrt.c +++ b/strided/special/dmskrsqrt/src/dmskrsqrt.c @@ -36,21 +36,21 @@ * include <stdint.h> * * // Create an input strided array: -* double x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; +* const double x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; * * // Create a mask strided array: -* uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +* const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; * * // Create an output strided array: * double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideM = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideM = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_dmskrsqrt( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/dmsksqrt/README.md b/strided/special/dmsksqrt/README.md index b19d16af4..b993dd20e 100644 --- a/strided/special/dmsksqrt/README.md +++ b/strided/special/dmsksqrt/README.md @@ -210,11 +210,11 @@ Computes the principal [square root][@stdlib/math/base/special/sqrt] for each el ```c #include <stdint.h> -double X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; -uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +const double X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; +const uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_dmsksqrt( N, X, 2, Mask, 2, Y, 2 ); ``` @@ -258,21 +258,21 @@ void stdlib_strided_dmsksqrt( const int64_t N, const double *X, const int64_t st int main( void ) { // Create an input strided array: - double X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; + const double X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; // Create a mask strided array: - uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dmsksqrt( N, X, strideX, M, strideM, Y, strideY ); diff --git a/strided/special/dmsksqrt/examples/c/example.c b/strided/special/dmsksqrt/examples/c/example.c index bfd93dad9..272b74814 100644 --- a/strided/special/dmsksqrt/examples/c/example.c +++ b/strided/special/dmsksqrt/examples/c/example.c @@ -22,21 +22,21 @@ int main( void ) { // Create an input strided array: - double x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; + const double x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; // Create a mask strided array: - uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dmsksqrt( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/dmsksqrt/src/dmsksqrt.c b/strided/special/dmsksqrt/src/dmsksqrt.c index 5aa917e72..aaa117fa5 100644 --- a/strided/special/dmsksqrt/src/dmsksqrt.c +++ b/strided/special/dmsksqrt/src/dmsksqrt.c @@ -36,21 +36,21 @@ * include <stdint.h> * * // Create an input strided array: -* double x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; +* const double x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; * * // Create a mask strided array: -* uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +* const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; * * // Create an output strided array: * double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideM = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideM = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_dmsksqrt( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/dmsktrunc/README.md b/strided/special/dmsktrunc/README.md index e623a3239..1c518ee4e 100644 --- a/strided/special/dmsktrunc/README.md +++ b/strided/special/dmsktrunc/README.md @@ -210,11 +210,11 @@ Rounds each element in a double-precision floating-point strided array `X` towar ```c #include <stdint.h> -double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; -uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +const double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +const uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_dmsktrunc( N, X, 2, Mask, 2, Y, 2 ); ``` @@ -258,21 +258,21 @@ void stdlib_strided_dmsktrunc( const int64_t N, const double *X, const int64_t s int main( void ) { // Create an input strided array: - double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create a mask strided array: - uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dmsktrunc( N, X, strideX, M, strideM, Y, strideY ); diff --git a/strided/special/dmsktrunc/examples/c/example.c b/strided/special/dmsktrunc/examples/c/example.c index a019091b3..90dabfe8f 100644 --- a/strided/special/dmsktrunc/examples/c/example.c +++ b/strided/special/dmsktrunc/examples/c/example.c @@ -22,21 +22,21 @@ int main( void ) { // Create an input strided array: - double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create a mask strided array: - uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dmsktrunc( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/dmsktrunc/src/dmsktrunc.c b/strided/special/dmsktrunc/src/dmsktrunc.c index b2b2c3cb9..405d755c7 100644 --- a/strided/special/dmsktrunc/src/dmsktrunc.c +++ b/strided/special/dmsktrunc/src/dmsktrunc.c @@ -36,21 +36,21 @@ * include <stdint.h> * * // Create an input strided array: -* double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +* const double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; * * // Create a mask strided array: -* uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +* const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; * * // Create an output strided array: * double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideM = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideM = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_dmsktrunc( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/dramp/README.md b/strided/special/dramp/README.md index 04b0d7e67..e01330888 100644 --- a/strided/special/dramp/README.md +++ b/strided/special/dramp/README.md @@ -190,10 +190,10 @@ Evaluates the ramp function for each element in a double-precision floating-poin ```c #include <stdint.h> -double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +const double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_dramp( N, X, 2, Y, 2 ); ``` @@ -235,17 +235,17 @@ void stdlib_strided_dramp( const int64_t N, const double *X, const int64_t strid int main( void ) { // Create an input strided array: - double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create an output strided array: double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dramp( N, X, strideX, Y, strideY ); diff --git a/strided/special/dramp/examples/c/example.c b/strided/special/dramp/examples/c/example.c index 78287ae10..3fbeab01f 100644 --- a/strided/special/dramp/examples/c/example.c +++ b/strided/special/dramp/examples/c/example.c @@ -22,17 +22,17 @@ int main( void ) { // Create an input strided array: - double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create an output strided array: double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dramp( N, x, strideX, y, strideY ); diff --git a/strided/special/dramp/src/dramp.c b/strided/special/dramp/src/dramp.c index fe5959671..6bdb20a79 100644 --- a/strided/special/dramp/src/dramp.c +++ b/strided/special/dramp/src/dramp.c @@ -34,17 +34,17 @@ * #include <stdint.h> * * // Create an input strided array: -* double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +* const double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; * * // Create an output strided array: * double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_dramp( N, x, strideX, y, strideY ); diff --git a/strided/special/drsqrt/README.md b/strided/special/drsqrt/README.md index be454c0a6..2e556f47e 100644 --- a/strided/special/drsqrt/README.md +++ b/strided/special/drsqrt/README.md @@ -190,10 +190,10 @@ Computes the reciprocal square root for each element in a double-precision float ```c #include <stdint.h> -double X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; +const double X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_drsqrt( N, X, 2, Y, 2 ); ``` @@ -235,17 +235,17 @@ void stdlib_strided_drsqrt( const int64_t N, const double *X, const int64_t stri int main( void ) { // Create an input strided array: - double X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; + const double X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; // Create an output strided array: double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_drsqrt( N, X, strideX, Y, strideY ); diff --git a/strided/special/drsqrt/examples/c/example.c b/strided/special/drsqrt/examples/c/example.c index a1953da0d..04ae20255 100644 --- a/strided/special/drsqrt/examples/c/example.c +++ b/strided/special/drsqrt/examples/c/example.c @@ -22,17 +22,17 @@ int main( void ) { // Create an input strided array: - double x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; + const double x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; // Create an output strided array: double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_drsqrt( N, x, strideX, y, strideY ); diff --git a/strided/special/drsqrt/src/drsqrt.c b/strided/special/drsqrt/src/drsqrt.c index 63ef920f3..352a686c0 100644 --- a/strided/special/drsqrt/src/drsqrt.c +++ b/strided/special/drsqrt/src/drsqrt.c @@ -34,17 +34,17 @@ * #include <stdint.h> * * // Create an input strided array: -* double x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; +* const double x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; * * // Create an output strided array: * double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_drsqrt( N, x, strideX, y, strideY ); diff --git a/strided/special/dsqrt/README.md b/strided/special/dsqrt/README.md index 13262c150..1941d6fd0 100644 --- a/strided/special/dsqrt/README.md +++ b/strided/special/dsqrt/README.md @@ -190,10 +190,10 @@ Computes the principal square root for each element in a double-precision floati ```c #include <stdint.h> -double X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; +const double X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_dsqrt( N, X, 2, Y, 2 ); ``` @@ -235,17 +235,17 @@ void stdlib_strided_dsqrt( const int64_t N, const double *X, const int64_t strid int main( void ) { // Create an input strided array: - double X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; + const double X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; // Create an output strided array: double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dsqrt( N, X, strideX, Y, strideY ); diff --git a/strided/special/dsqrt/examples/c/example.c b/strided/special/dsqrt/examples/c/example.c index 7b5aa8d16..48c968181 100644 --- a/strided/special/dsqrt/examples/c/example.c +++ b/strided/special/dsqrt/examples/c/example.c @@ -22,17 +22,17 @@ int main( void ) { // Create an input strided array: - double x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; + const double x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; // Create an output strided array: double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dsqrt( N, x, strideX, y, strideY ); diff --git a/strided/special/dsqrt/src/dsqrt.c b/strided/special/dsqrt/src/dsqrt.c index ad44d4491..4cba9def1 100644 --- a/strided/special/dsqrt/src/dsqrt.c +++ b/strided/special/dsqrt/src/dsqrt.c @@ -34,17 +34,17 @@ * #include <stdint.h> * * // Create an input strided array: -* double x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; +* const double x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; * * // Create an output strided array: * double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_dsqrt( N, x, strideX, y, strideY ); diff --git a/strided/special/dtrunc/README.md b/strided/special/dtrunc/README.md index ed786b843..a6648eee6 100644 --- a/strided/special/dtrunc/README.md +++ b/strided/special/dtrunc/README.md @@ -190,10 +190,10 @@ Rounds each element in a double-precision floating-point strided array `X` towar ```c #include <stdint.h> -double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +const double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_dtrunc( N, X, 2, Y, 2 ); ``` @@ -235,17 +235,17 @@ void stdlib_strided_dtrunc( const int64_t N, const double *X, const int64_t stri int main( void ) { // Create an input strided array: - double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const double X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create an output strided array: double Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dtrunc( N, X, strideX, Y, strideY ); diff --git a/strided/special/dtrunc/examples/c/example.c b/strided/special/dtrunc/examples/c/example.c index b94c1897b..47cc725d8 100644 --- a/strided/special/dtrunc/examples/c/example.c +++ b/strided/special/dtrunc/examples/c/example.c @@ -22,17 +22,17 @@ int main( void ) { // Create an input strided array: - double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create an output strided array: double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_dtrunc( N, x, strideX, y, strideY ); diff --git a/strided/special/dtrunc/src/dtrunc.c b/strided/special/dtrunc/src/dtrunc.c index 4dd237b2c..615c7e957 100644 --- a/strided/special/dtrunc/src/dtrunc.c +++ b/strided/special/dtrunc/src/dtrunc.c @@ -34,17 +34,17 @@ * #include <stdint.h> * * // Create an input strided array: -* double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +* const double x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; * * // Create an output strided array: * double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_dtrunc( N, x, strideX, y, strideY ); diff --git a/strided/special/sabs/README.md b/strided/special/sabs/README.md index 39c912cad..03a1dfb53 100644 --- a/strided/special/sabs/README.md +++ b/strided/special/sabs/README.md @@ -200,10 +200,10 @@ Computes the absolute value for each element in a single-precision floating-poin ```c #include <stdint.h> -float X[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; +const float X[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_sabs( N, X, 2, Y, 2 ); ``` @@ -245,17 +245,17 @@ void stdlib_strided_sabs( const int64_t N, const float *X, const int64_t strideX int main( void ) { // Create an input strided array: - float X[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; + const float X[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; // Create an output strided array: float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the absolute value element-wise: stdlib_strided_sabs( N, X, strideX, Y, strideY ); diff --git a/strided/special/sabs/examples/c/example.c b/strided/special/sabs/examples/c/example.c index 41736d8bd..e31d1b433 100644 --- a/strided/special/sabs/examples/c/example.c +++ b/strided/special/sabs/examples/c/example.c @@ -22,17 +22,17 @@ int main( void ) { // Create an input strided array: - float x[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; + const float x[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; // Create an output strided array: float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the absolute value element-wise: stdlib_strided_sabs( N, x, strideX, y, strideY ); diff --git a/strided/special/sabs/src/sabs.c b/strided/special/sabs/src/sabs.c index d881d4cfb..91e9ddc3e 100644 --- a/strided/special/sabs/src/sabs.c +++ b/strided/special/sabs/src/sabs.c @@ -34,17 +34,17 @@ * #include <stdint.h> * * // Create an input strided array: -* float x[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; +* const float x[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; * * // Create an output strided array: * float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideY = 2; * * // Compute the absolute value element-wise: * stdlib_strided_sabs( N, x, strideX, y, strideY ); diff --git a/strided/special/sabs2/README.md b/strided/special/sabs2/README.md index 650dca1f1..619a74122 100644 --- a/strided/special/sabs2/README.md +++ b/strided/special/sabs2/README.md @@ -200,10 +200,10 @@ Computes the squared absolute value for each element in a single-precision float ```c #include <stdint.h> -float X[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; +const float X[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_sabs2( N, X, 2, Y, 2 ); ``` @@ -245,17 +245,17 @@ void stdlib_strided_sabs2( const int64_t N, const float *X, const int64_t stride int main( void ) { // Create an input strided array: - float X[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; + const float X[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; // Create an output strided array: float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the squared absolute value element-wise: stdlib_strided_sabs2( N, X, strideX, Y, strideY ); diff --git a/strided/special/sabs2/examples/c/example.c b/strided/special/sabs2/examples/c/example.c index 6f65db8e3..9fd0fbbcb 100644 --- a/strided/special/sabs2/examples/c/example.c +++ b/strided/special/sabs2/examples/c/example.c @@ -22,17 +22,17 @@ int main( void ) { // Create an input strided array: - float x[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; + const float x[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; // Create an output strided array: float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the squared absolute value element-wise: stdlib_strided_sabs2( N, x, strideX, y, strideY ); diff --git a/strided/special/sabs2/src/sabs2.c b/strided/special/sabs2/src/sabs2.c index f7eef5119..2deb44fc9 100644 --- a/strided/special/sabs2/src/sabs2.c +++ b/strided/special/sabs2/src/sabs2.c @@ -34,17 +34,17 @@ * #include <stdint.h> * * // Create an input strided array: -* float x[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; +* const float x[] = { -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0 }; * * // Create an output strided array: * float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideY = 2; * * // Compute the squared absolute value element-wise: * stdlib_strided_sabs2( N, x, strideX, y, strideY ); diff --git a/strided/special/scbrt/README.md b/strided/special/scbrt/README.md index f6f86ee60..7476c0e79 100644 --- a/strided/special/scbrt/README.md +++ b/strided/special/scbrt/README.md @@ -190,10 +190,10 @@ Computes the cube root of each element in a single-precision floating-point stri ```c #include <stdint.h> -float X[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; +const float X[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_scbrt( N, X, 2, Y, 2 ); ``` @@ -235,17 +235,17 @@ void stdlib_strided_scbrt( const int64_t N, const float *X, const int64_t stride int main( void ) { // Create an input strided array: - float X[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; + const float X[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; // Create an output strided array: float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_scbrt( N, X, strideX, Y, strideY ); diff --git a/strided/special/scbrt/examples/c/example.c b/strided/special/scbrt/examples/c/example.c index 9573819ec..1fd5b2470 100644 --- a/strided/special/scbrt/examples/c/example.c +++ b/strided/special/scbrt/examples/c/example.c @@ -22,17 +22,17 @@ int main( void ) { // Create an input strided array: - float x[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; + const float x[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; // Create an output strided array: float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_scbrt( N, x, strideX, y, strideY ); diff --git a/strided/special/scbrt/src/scbrt.c b/strided/special/scbrt/src/scbrt.c index 18cea8fef..ad60b605a 100644 --- a/strided/special/scbrt/src/scbrt.c +++ b/strided/special/scbrt/src/scbrt.c @@ -34,17 +34,17 @@ * #include <stdint.h> * * // Create an input strided array: -* float x[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; +* const float x[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; * * // Create an output strided array: * float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_scbrt( N, x, strideX, y, strideY ); diff --git a/strided/special/sceil/README.md b/strided/special/sceil/README.md index 9b42f67f6..abd05a679 100644 --- a/strided/special/sceil/README.md +++ b/strided/special/sceil/README.md @@ -190,10 +190,10 @@ Rounds each element in a single-precision floating-point strided array `X` towar ```c #include <stdint.h> -float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +const float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_sceil( N, X, 2, Y, 2 ); ``` @@ -235,17 +235,17 @@ void stdlib_strided_sceil( const int64_t N, const float *X, const int64_t stride int main( void ) { // Create an input strided array: - float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create an output strided array: float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_sceil( N, X, strideX, Y, strideY ); diff --git a/strided/special/sceil/examples/c/example.c b/strided/special/sceil/examples/c/example.c index 655c748b9..6e9c502f8 100644 --- a/strided/special/sceil/examples/c/example.c +++ b/strided/special/sceil/examples/c/example.c @@ -22,17 +22,17 @@ int main( void ) { // Create an input strided array: - float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create an output strided array: float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_sceil( N, x, strideX, y, strideY ); diff --git a/strided/special/sceil/src/sceil.c b/strided/special/sceil/src/sceil.c index 2af165dd0..e94a4a53e 100644 --- a/strided/special/sceil/src/sceil.c +++ b/strided/special/sceil/src/sceil.c @@ -34,17 +34,17 @@ * #include <stdint.h> * * // Create an input strided array: -* float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +* const float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; * * // Create an output strided array: * float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_sceil( N, x, strideX, y, strideY ); diff --git a/strided/special/sdeg2rad/README.md b/strided/special/sdeg2rad/README.md index c6ca45cbc..2a2477841 100644 --- a/strided/special/sdeg2rad/README.md +++ b/strided/special/sdeg2rad/README.md @@ -190,10 +190,10 @@ Converts each element in a single-precision floating-point strided array `x` fro ```c #include <stdint.h> -float X[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; +const float X[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_sdeg2rad( N, X, 2, Y, 2 ); ``` @@ -235,17 +235,17 @@ void stdlib_strided_sdeg2rad( const int64_t N, const float *X, const int64_t str int main( void ) { // Create an input strided array: - float X[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; + const float X[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; // Create an output strided array: float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_sdeg2rad( N, X, strideX, Y, strideY ); diff --git a/strided/special/sdeg2rad/examples/c/example.c b/strided/special/sdeg2rad/examples/c/example.c index d70bad135..48ad48dd3 100644 --- a/strided/special/sdeg2rad/examples/c/example.c +++ b/strided/special/sdeg2rad/examples/c/example.c @@ -22,17 +22,17 @@ int main( void ) { // Create an input strided array: - float x[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; + const float x[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; // Create an output strided array: float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_sdeg2rad( N, x, strideX, y, strideY ); diff --git a/strided/special/sdeg2rad/src/sdeg2rad.c b/strided/special/sdeg2rad/src/sdeg2rad.c index 4b9ed14d0..438b2a388 100644 --- a/strided/special/sdeg2rad/src/sdeg2rad.c +++ b/strided/special/sdeg2rad/src/sdeg2rad.c @@ -34,17 +34,17 @@ * #include <stdint.h> * * // Create an input strided array: -* float x[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; +* const float x[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; * * // Create an output strided array: * float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_sdeg2rad( N, x, strideX, y, strideY ); diff --git a/strided/special/sfloor/README.md b/strided/special/sfloor/README.md index fe939d9a8..f62091bc8 100644 --- a/strided/special/sfloor/README.md +++ b/strided/special/sfloor/README.md @@ -190,10 +190,10 @@ Rounds each element in a single-precision floating-point strided array `X` towar ```c #include <stdint.h> -float X[] = { -1.5, 2.3, -3.9, 4.2, -5.0, -6.0, 7.9, -8.1 }; +const float X[] = { -1.5, 2.3, -3.9, 4.2, -5.0, -6.0, 7.9, -8.1 }; float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_sfloor( N, X, 2, Y, 2 ); ``` @@ -235,17 +235,17 @@ void stdlib_strided_sfloor( const int64_t N, const float *X, const int64_t strid int main( void ) { // Create an input strided array: - float X[] = { -1.5, 2.3, -3.9, 4.2, -5.0, -6.0, 7.9, -8.1 }; + const float X[] = { -1.5, 2.3, -3.9, 4.2, -5.0, -6.0, 7.9, -8.1 }; // Create an output strided array: float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_sfloor( N, X, strideX, Y, strideY ); diff --git a/strided/special/sfloor/examples/c/example.c b/strided/special/sfloor/examples/c/example.c index 63289bf00..6181a9e8d 100644 --- a/strided/special/sfloor/examples/c/example.c +++ b/strided/special/sfloor/examples/c/example.c @@ -22,17 +22,17 @@ int main( void ) { // Create an input strided array: - float x[] = { -1.5, 2.3, -3.9, 4.2, -5.0, -6.0, 7.9, -8.1 }; + const float x[] = { -1.5, 2.3, -3.9, 4.2, -5.0, -6.0, 7.9, -8.1 }; // Create an output strided array: float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_sfloor( N, x, strideX, y, strideY ); diff --git a/strided/special/sfloor/src/sfloor.c b/strided/special/sfloor/src/sfloor.c index 26e9140a2..b612ecb4a 100644 --- a/strided/special/sfloor/src/sfloor.c +++ b/strided/special/sfloor/src/sfloor.c @@ -34,17 +34,17 @@ * #include <stdint.h> * * // Create an input strided array: -* float x[] = { -1.5, 2.3, -3.9, 4.2, -5.0, -6.0, 7.9, -8.1 }; +* const float x[] = { -1.5, 2.3, -3.9, 4.2, -5.0, -6.0, 7.9, -8.1 }; * * // Create an output strided array: * float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_sfloor( N, x, strideX, y, strideY ); diff --git a/strided/special/sinv/README.md b/strided/special/sinv/README.md index 9f8a8fe51..321d1bce8 100644 --- a/strided/special/sinv/README.md +++ b/strided/special/sinv/README.md @@ -190,10 +190,10 @@ Computes the multiplicative inverse for each element in a single-precision float ```c #include <stdint.h> -float X[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; +const float X[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_sinv( N, X, 2, Y, 2 ); ``` @@ -235,17 +235,17 @@ void stdlib_strided_sinv( const int64_t N, const float *X, const int64_t strideX int main( void ) { // Create an input strided array: - float X[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; + const float X[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; // Create an output strided array: float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_sinv( N, X, strideX, Y, strideY ); diff --git a/strided/special/sinv/examples/c/example.c b/strided/special/sinv/examples/c/example.c index 8a3912291..038897992 100644 --- a/strided/special/sinv/examples/c/example.c +++ b/strided/special/sinv/examples/c/example.c @@ -22,17 +22,17 @@ int main( void ) { // Create an input strided array: - float x[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; + const float x[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; // Create an output strided array: float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_sinv( N, x, strideX, y, strideY ); diff --git a/strided/special/sinv/src/sinv.c b/strided/special/sinv/src/sinv.c index 131d496b2..9440ef941 100644 --- a/strided/special/sinv/src/sinv.c +++ b/strided/special/sinv/src/sinv.c @@ -34,17 +34,17 @@ * #include <stdint.h> * * // Create an input strided array: -* float x[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; +* const float x[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; * * // Create an output strided array: * float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_sinv( N, x, strideX, y, strideY ); diff --git a/strided/special/smskabs/README.md b/strided/special/smskabs/README.md index d63f4fe81..2cacedc02 100644 --- a/strided/special/smskabs/README.md +++ b/strided/special/smskabs/README.md @@ -210,11 +210,11 @@ Computes the [absolute value][@stdlib/math/base/special/absf] for each element i ```c #include <stdint.h> -float X[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; -uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +const float X[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; +const uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_smskabs( N, X, 2, Mask, 2, Y, 2 ); ``` @@ -258,21 +258,21 @@ void stdlib_strided_smskabs( const int64_t N, const float *X, const int64_t stri int main( void ) { // Create an input strided array: - float X[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; + const float X[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; // Create a mask strided array: - uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_smskabs( N, X, strideX, M, strideM, Y, strideY ); diff --git a/strided/special/smskabs/examples/c/example.c b/strided/special/smskabs/examples/c/example.c index 4b6ffaf56..daded2eff 100644 --- a/strided/special/smskabs/examples/c/example.c +++ b/strided/special/smskabs/examples/c/example.c @@ -22,21 +22,21 @@ int main( void ) { // Create an input strided array: - float x[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; + const float x[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; // Create a mask strided array: - uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_smskabs( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/smskabs/src/smskabs.c b/strided/special/smskabs/src/smskabs.c index ee439d433..ea90edf4f 100644 --- a/strided/special/smskabs/src/smskabs.c +++ b/strided/special/smskabs/src/smskabs.c @@ -36,21 +36,21 @@ * include <stdint.h> * * // Create an input strided array: -* float x[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; +* const float x[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; * * // Create a mask strided array: -* uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +* const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; * * // Create an output strided array: * float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideM = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideM = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_smskabs( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/smskabs2/README.md b/strided/special/smskabs2/README.md index 647e7b0b2..8cd8db6e5 100644 --- a/strided/special/smskabs2/README.md +++ b/strided/special/smskabs2/README.md @@ -210,11 +210,11 @@ Computes the [squared absolute value][@stdlib/math/base/special/abs2f] for each ```c #include <stdint.h> -float X[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; -uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +const float X[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; +const uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_smskabs2( N, X, 2, Mask, 2, Y, 2 ); ``` @@ -258,21 +258,21 @@ void stdlib_strided_smskabs2( const int64_t N, const float *X, const int64_t str int main( void ) { // Create an input strided array: - float X[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; + const float X[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; // Create a mask strided array: - uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_smskabs2( N, X, strideX, M, strideM, Y, strideY ); diff --git a/strided/special/smskabs2/examples/c/example.c b/strided/special/smskabs2/examples/c/example.c index 3cdc0734d..1e43d935e 100644 --- a/strided/special/smskabs2/examples/c/example.c +++ b/strided/special/smskabs2/examples/c/example.c @@ -22,21 +22,21 @@ int main( void ) { // Create an input strided array: - float x[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; + const float x[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; // Create a mask strided array: - uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_smskabs2( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/smskabs2/src/smskabs2.c b/strided/special/smskabs2/src/smskabs2.c index 57f84c9b9..fb3e0fc02 100644 --- a/strided/special/smskabs2/src/smskabs2.c +++ b/strided/special/smskabs2/src/smskabs2.c @@ -36,21 +36,21 @@ * include <stdint.h> * * // Create an input strided array: -* float x[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; +* const float x[] = { -2.0, 1.0, -3.0, -5.0, 4.0, 0.0, -1.0, -3.0 }; * * // Create a mask strided array: -* uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +* const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; * * // Create an output strided array: * float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideM = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideM = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_smskabs2( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/smskcbrt/README.md b/strided/special/smskcbrt/README.md index 21ce449ce..52b3b30f6 100644 --- a/strided/special/smskcbrt/README.md +++ b/strided/special/smskcbrt/README.md @@ -210,11 +210,11 @@ Computes the [cube root][@stdlib/math/base/special/cbrtf] for each element in a ```c #include <stdint.h> -float X[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; -uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +const float X[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; +const uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_smskcbrt( N, X, 2, Mask, 2, Y, 2 ); ``` @@ -258,21 +258,21 @@ void stdlib_strided_smskcbrt( const int64_t N, const float *X, const int64_t str int main( void ) { // Create an input strided array: - float X[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; + const float X[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; // Create a mask strided array: - uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_smskcbrt( N, X, strideX, M, strideM, Y, strideY ); diff --git a/strided/special/smskcbrt/examples/c/example.c b/strided/special/smskcbrt/examples/c/example.c index f7ead8871..71f9e7c3f 100644 --- a/strided/special/smskcbrt/examples/c/example.c +++ b/strided/special/smskcbrt/examples/c/example.c @@ -22,21 +22,21 @@ int main( void ) { // Create an input strided array: - float x[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; + const float x[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; // Create a mask strided array: - uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_smskcbrt( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/smskcbrt/src/smskcbrt.c b/strided/special/smskcbrt/src/smskcbrt.c index 38ad56266..940fbde77 100644 --- a/strided/special/smskcbrt/src/smskcbrt.c +++ b/strided/special/smskcbrt/src/smskcbrt.c @@ -36,21 +36,21 @@ * include <stdint.h> * * // Create an input strided array: -* float x[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; +* const float x[] = { 0.0, 1.0, 8.0, 27.0, 64.0, 125.0, 216.0, 343.0 }; * * // Create a mask strided array: -* uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +* const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; * * // Create an output strided array: * float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideM = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideM = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_smskcbrt( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/smskceil/README.md b/strided/special/smskceil/README.md index be794916b..0ea46757f 100644 --- a/strided/special/smskceil/README.md +++ b/strided/special/smskceil/README.md @@ -210,11 +210,11 @@ Rounds each element in a single-precision floating-point strided array `X` towar ```c #include <stdint.h> -float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; -uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +const float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +const uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_smskceil( N, X, 2, Mask, 2, Y, 2 ); ``` @@ -258,21 +258,21 @@ void stdlib_strided_smskceil( const int64_t N, const float *X, const int64_t str int main( void ) { // Create an input strided array: - float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create a mask strided array: - uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_smskceil( N, X, strideX, M, strideM, Y, strideY ); diff --git a/strided/special/smskceil/examples/c/example.c b/strided/special/smskceil/examples/c/example.c index f6ec09e9d..a6e82ef1b 100644 --- a/strided/special/smskceil/examples/c/example.c +++ b/strided/special/smskceil/examples/c/example.c @@ -22,21 +22,21 @@ int main( void ) { // Create an input strided array: - float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create a mask strided array: - uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_smskceil( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/smskceil/src/smskceil.c b/strided/special/smskceil/src/smskceil.c index ad9eda578..25c75b9dd 100644 --- a/strided/special/smskceil/src/smskceil.c +++ b/strided/special/smskceil/src/smskceil.c @@ -36,21 +36,21 @@ * include <stdint.h> * * // Create an input strided array: -* float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +* const float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; * * // Create a mask strided array: -* uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +* const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; * * // Create an output strided array: * float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideM = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideM = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_smskceil( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/smskdeg2rad/README.md b/strided/special/smskdeg2rad/README.md index ba198c0fe..c74de0482 100644 --- a/strided/special/smskdeg2rad/README.md +++ b/strided/special/smskdeg2rad/README.md @@ -210,11 +210,11 @@ Converts each element in a single-precision floating-point strided array `X` fro ```c #include <stdint.h> -float X[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; -uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +const float X[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; +const uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_smskdeg2rad( N, X, 2, Mask, 2, Y, 2 ); ``` @@ -258,21 +258,21 @@ void stdlib_strided_smskdeg2rad( const int64_t N, const float *X, const int64_t int main( void ) { // Create an input strided array: - float X[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; + const float X[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; // Create a mask strided array: - uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_smskdeg2rad( N, X, strideX, M, strideM, Y, strideY ); diff --git a/strided/special/smskdeg2rad/examples/c/example.c b/strided/special/smskdeg2rad/examples/c/example.c index 87b496bc8..a478f9d7e 100644 --- a/strided/special/smskdeg2rad/examples/c/example.c +++ b/strided/special/smskdeg2rad/examples/c/example.c @@ -22,21 +22,21 @@ int main( void ) { // Create an input strided array: - float x[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; + const float x[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; // Create a mask strided array: - uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_smskdeg2rad( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/smskdeg2rad/src/smskdeg2rad.c b/strided/special/smskdeg2rad/src/smskdeg2rad.c index a16ece68a..aa0ed77c3 100644 --- a/strided/special/smskdeg2rad/src/smskdeg2rad.c +++ b/strided/special/smskdeg2rad/src/smskdeg2rad.c @@ -36,21 +36,21 @@ * include <stdint.h> * * // Create an input strided array: -* float x[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; +* const float x[] = { 0.0, 30.0, 45.0, 60.0, 90.0, 120.0, 150.0, 180.0 }; * * // Create a mask strided array: -* uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +* const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; * * // Create an output strided array: * float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideM = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideM = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_smskdeg2rad( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/smskfloor/README.md b/strided/special/smskfloor/README.md index 3222f7da8..3d803250d 100644 --- a/strided/special/smskfloor/README.md +++ b/strided/special/smskfloor/README.md @@ -210,11 +210,11 @@ Rounds each element in a single-precision floating-point strided array `X` towar ```c #include <stdint.h> -float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; -uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +const float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +const uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_smskfloor( N, X, 2, Mask, 2, Y, 2 ); ``` @@ -258,21 +258,21 @@ void stdlib_strided_smskfloor( const int64_t N, const float *X, const int64_t st int main( void ) { // Create an input strided array: - float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create a mask strided array: - uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_smskfloor( N, X, strideX, M, strideM, Y, strideY ); diff --git a/strided/special/smskfloor/examples/c/example.c b/strided/special/smskfloor/examples/c/example.c index 9703a59e5..ed57cb8ec 100644 --- a/strided/special/smskfloor/examples/c/example.c +++ b/strided/special/smskfloor/examples/c/example.c @@ -22,21 +22,21 @@ int main( void ) { // Create an input strided array: - float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create a mask strided array: - uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_smskfloor( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/smskfloor/src/smskfloor.c b/strided/special/smskfloor/src/smskfloor.c index b5043d471..8049a5f87 100644 --- a/strided/special/smskfloor/src/smskfloor.c +++ b/strided/special/smskfloor/src/smskfloor.c @@ -36,21 +36,21 @@ * include <stdint.h> * * // Create an input strided array: -* float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +* const float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; * * // Create a mask strided array: -* uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +* const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; * * // Create an output strided array: * float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideM = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideM = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_smskfloor( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/smskinv/README.md b/strided/special/smskinv/README.md index e36cce215..71f5782e1 100644 --- a/strided/special/smskinv/README.md +++ b/strided/special/smskinv/README.md @@ -210,11 +210,11 @@ Computes the [multiplicative inverse][@stdlib/math/base/special/invf] for each e ```c #include <stdint.h> -float X[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; -uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +const float X[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; +const uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_smskinv( N, X, 2, Mask, 2, Y, 2 ); ``` @@ -258,21 +258,21 @@ void stdlib_strided_smskinv( const int64_t N, const float *X, const int64_t stri int main( void ) { // Create an input strided array: - float X[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; + const float X[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; // Create a mask strided array: - uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_smskinv( N, X, strideX, M, strideM, Y, strideY ); diff --git a/strided/special/smskinv/examples/c/example.c b/strided/special/smskinv/examples/c/example.c index d7c279716..b72b743bf 100644 --- a/strided/special/smskinv/examples/c/example.c +++ b/strided/special/smskinv/examples/c/example.c @@ -22,21 +22,21 @@ int main( void ) { // Create an input strided array: - float x[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; + const float x[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; // Create a mask strided array: - uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_smskinv( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/smskinv/src/smskinv.c b/strided/special/smskinv/src/smskinv.c index 2981f6601..5201d5221 100644 --- a/strided/special/smskinv/src/smskinv.c +++ b/strided/special/smskinv/src/smskinv.c @@ -36,21 +36,21 @@ * include <stdint.h> * * // Create an input strided array: -* float x[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; +* const float x[] = { -20.0, -1.0, 2.0, 4.0, 10.0, 100.0, 0.0, -0.0 }; * * // Create a mask strided array: -* uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +* const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; * * // Create an output strided array: * float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideM = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideM = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_smskinv( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/smskramp/README.md b/strided/special/smskramp/README.md index 29625bebe..b8e635acc 100644 --- a/strided/special/smskramp/README.md +++ b/strided/special/smskramp/README.md @@ -210,11 +210,11 @@ Evaluates the [ramp function][@stdlib/math/base/special/rampf] for each element ```c #include <stdint.h> -float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; -uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +const float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +const uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_smskramp( N, X, 2, Mask, 2, Y, 2 ); ``` @@ -258,21 +258,21 @@ void stdlib_strided_smskramp( const int64_t N, const float *X, const int64_t str int main( void ) { // Create an input strided array: - float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create a mask strided array: - uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_smskramp( N, X, strideX, M, strideM, Y, strideY ); diff --git a/strided/special/smskramp/examples/c/example.c b/strided/special/smskramp/examples/c/example.c index 01dea9da4..a740abf6f 100644 --- a/strided/special/smskramp/examples/c/example.c +++ b/strided/special/smskramp/examples/c/example.c @@ -22,21 +22,21 @@ int main( void ) { // Create an input strided array: - float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create a mask strided array: - uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_smskramp( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/smskramp/src/smskramp.c b/strided/special/smskramp/src/smskramp.c index 53ef97ff8..0ddcdcc8b 100644 --- a/strided/special/smskramp/src/smskramp.c +++ b/strided/special/smskramp/src/smskramp.c @@ -36,21 +36,21 @@ * include <stdint.h> * * // Create an input strided array: -* float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +* const float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; * * // Create a mask strided array: -* uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +* const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; * * // Create an output strided array: * float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideM = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideM = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_smskramp( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/smskrsqrt/README.md b/strided/special/smskrsqrt/README.md index bbb44b185..5b0d4e84b 100644 --- a/strided/special/smskrsqrt/README.md +++ b/strided/special/smskrsqrt/README.md @@ -210,11 +210,11 @@ Computes the [reciprocal square root][@stdlib/math/base/special/rsqrtf] for each ```c #include <stdint.h> -float X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; -uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +const float X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; +const uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_smskrsqrt( N, X, 2, Mask, 2, Y, 2 ); ``` @@ -258,21 +258,21 @@ void stdlib_strided_smskrsqrt( const int64_t N, const float *X, const int64_t st int main( void ) { // Create an input strided array: - float X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; + const float X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; // Create a mask strided array: - uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_smskrsqrt( N, X, strideX, M, strideM, Y, strideY ); diff --git a/strided/special/smskrsqrt/examples/c/example.c b/strided/special/smskrsqrt/examples/c/example.c index 51375594e..5516d783d 100644 --- a/strided/special/smskrsqrt/examples/c/example.c +++ b/strided/special/smskrsqrt/examples/c/example.c @@ -22,21 +22,21 @@ int main( void ) { // Create an input strided array: - float x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; + const float x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; // Create a mask strided array: - uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_smskrsqrt( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/smskrsqrt/src/smskrsqrt.c b/strided/special/smskrsqrt/src/smskrsqrt.c index 4d885127c..b960209cd 100644 --- a/strided/special/smskrsqrt/src/smskrsqrt.c +++ b/strided/special/smskrsqrt/src/smskrsqrt.c @@ -36,21 +36,21 @@ * include <stdint.h> * * // Create an input strided array: -* float x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; +* const float x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; * * // Create a mask strided array: -* uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +* const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; * * // Create an output strided array: * float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideM = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideM = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_smskrsqrt( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/smsksqrt/README.md b/strided/special/smsksqrt/README.md index 6817eaea4..0a107ce97 100644 --- a/strided/special/smsksqrt/README.md +++ b/strided/special/smsksqrt/README.md @@ -210,11 +210,11 @@ Computes the principal [square root][@stdlib/math/base/special/sqrtf] for each e ```c #include <stdint.h> -float X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; -uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +const float X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; +const uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_smsksqrt( N, X, 2, Mask, 2, Y, 2 ); ``` @@ -258,21 +258,21 @@ void stdlib_strided_smsksqrt( const int64_t N, const float *X, const int64_t str int main( void ) { // Create an input strided array: - float X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; + const float X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; // Create a mask strided array: - uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_smsksqrt( N, X, strideX, M, strideM, Y, strideY ); diff --git a/strided/special/smsksqrt/examples/c/example.c b/strided/special/smsksqrt/examples/c/example.c index af88daa87..e618f7553 100644 --- a/strided/special/smsksqrt/examples/c/example.c +++ b/strided/special/smsksqrt/examples/c/example.c @@ -22,21 +22,21 @@ int main( void ) { // Create an input strided array: - float x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; + const float x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; // Create a mask strided array: - uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_smsksqrt( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/smsksqrt/src/smsksqrt.c b/strided/special/smsksqrt/src/smsksqrt.c index 35f75124c..ef94fa3ff 100644 --- a/strided/special/smsksqrt/src/smsksqrt.c +++ b/strided/special/smsksqrt/src/smsksqrt.c @@ -36,21 +36,21 @@ * include <stdint.h> * * // Create an input strided array: -* float x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; +* const float x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; * * // Create a mask strided array: -* uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +* const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; * * // Create an output strided array: * float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideM = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideM = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_smsksqrt( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/smsktrunc/README.md b/strided/special/smsktrunc/README.md index c98728bf1..108fca6e8 100644 --- a/strided/special/smsktrunc/README.md +++ b/strided/special/smsktrunc/README.md @@ -210,11 +210,11 @@ Rounds each element in a single-precision floating-point strided array `X` towar ```c #include <stdint.h> -float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; -uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +const float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +const uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_smsktrunc( N, X, 2, Mask, 2, Y, 2 ); ``` @@ -258,21 +258,21 @@ void stdlib_strided_smsktrunc( const int64_t N, const float *X, const int64_t st int main( void ) { // Create an input strided array: - float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create a mask strided array: - uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_smsktrunc( N, X, strideX, M, strideM, Y, strideY ); diff --git a/strided/special/smsktrunc/examples/c/example.c b/strided/special/smsktrunc/examples/c/example.c index 5a0964958..067fad4c7 100644 --- a/strided/special/smsktrunc/examples/c/example.c +++ b/strided/special/smsktrunc/examples/c/example.c @@ -22,21 +22,21 @@ int main( void ) { // Create an input strided array: - float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create a mask strided array: - uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_smsktrunc( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/smsktrunc/src/smsktrunc.c b/strided/special/smsktrunc/src/smsktrunc.c index 444239e54..3abe877b3 100644 --- a/strided/special/smsktrunc/src/smsktrunc.c +++ b/strided/special/smsktrunc/src/smsktrunc.c @@ -36,21 +36,21 @@ * include <stdint.h> * * // Create an input strided array: -* float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +* const float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; * * // Create a mask strided array: -* uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +* const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; * * // Create an output strided array: * float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideM = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideM = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_smsktrunc( N, x, strideX, m, strideM, y, strideY ); diff --git a/strided/special/sramp/README.md b/strided/special/sramp/README.md index 16586e639..0804eb94e 100644 --- a/strided/special/sramp/README.md +++ b/strided/special/sramp/README.md @@ -190,10 +190,10 @@ Evaluates the ramp function for each element in a single-precision floating-poin ```c #include <stdint.h> -float X[] = { 1.0, 2.0, -3.0, 4.0, -5.0, 6.0, -7.0, 8.0 }; +const float X[] = { 1.0, 2.0, -3.0, 4.0, -5.0, 6.0, -7.0, 8.0 }; float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_sramp( N, X, 2, Y, 2 ); ``` @@ -235,17 +235,17 @@ void stdlib_strided_sramp( const int64_t N, const float *X, const int64_t stride int main( void ) { // Create an input strided array: - float X[] = { 1.0, 2.0, -3.0, 4.0, -5.0, 6.0, -7.0, 8.0 }; + const float X[] = { 1.0, 2.0, -3.0, 4.0, -5.0, 6.0, -7.0, 8.0 }; // Create an output strided array: float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_sramp( N, X, strideX, Y, strideY ); diff --git a/strided/special/sramp/examples/c/example.c b/strided/special/sramp/examples/c/example.c index d653aee5a..d134d15cd 100644 --- a/strided/special/sramp/examples/c/example.c +++ b/strided/special/sramp/examples/c/example.c @@ -22,17 +22,17 @@ int main( void ) { // Create an input strided array: - float x[] = { 1.0, 2.0, -3.0, 4.0, -5.0, 6.0, -7.0, 8.0 }; + const float x[] = { 1.0, 2.0, -3.0, 4.0, -5.0, 6.0, -7.0, 8.0 }; // Create an output strided array: float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_sramp( N, x, strideX, y, strideY ); diff --git a/strided/special/sramp/src/sramp.c b/strided/special/sramp/src/sramp.c index 544758b1e..e167ca5c7 100644 --- a/strided/special/sramp/src/sramp.c +++ b/strided/special/sramp/src/sramp.c @@ -34,17 +34,17 @@ * #include <stdint.h> * * // Create an input strided array: -* float x[] = { 1.0, 2.0, -3.0, 4.0, -5.0, 6.0, -7.0, 8.0 }; +* const float x[] = { 1.0, 2.0, -3.0, 4.0, -5.0, 6.0, -7.0, 8.0 }; * * // Create an output strided array: * float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_sramp( N, x, strideX, y, strideY ); diff --git a/strided/special/srsqrt/README.md b/strided/special/srsqrt/README.md index f42a62881..0997872a9 100644 --- a/strided/special/srsqrt/README.md +++ b/strided/special/srsqrt/README.md @@ -190,10 +190,10 @@ Computes the reciprocal square root for each element in a single-precision float ```c #include <stdint.h> -float X[] = { 1.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; +const float X[] = { 1.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_srsqrt( N, X, 2, Y, 2 ); ``` @@ -235,17 +235,17 @@ void stdlib_strided_srsqrt( const int64_t N, const float *X, const int64_t strid int main( void ) { // Create an input strided array: - float X[] = { 1.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; + const float X[] = { 1.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; // Create an output strided array: float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_srsqrt( N, X, strideX, Y, strideY ); diff --git a/strided/special/srsqrt/examples/c/example.c b/strided/special/srsqrt/examples/c/example.c index 93f2601a8..bc7676fcd 100644 --- a/strided/special/srsqrt/examples/c/example.c +++ b/strided/special/srsqrt/examples/c/example.c @@ -22,17 +22,17 @@ int main( void ) { // Create an input strided array: - float x[] = { 1.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; + const float x[] = { 1.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; // Create an output strided array: float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_srsqrt( N, x, strideX, y, strideY ); diff --git a/strided/special/srsqrt/src/srsqrt.c b/strided/special/srsqrt/src/srsqrt.c index c930b2f4d..10ad46f4d 100644 --- a/strided/special/srsqrt/src/srsqrt.c +++ b/strided/special/srsqrt/src/srsqrt.c @@ -34,17 +34,17 @@ * #include <stdint.h> * * // Create an input strided array: -* float x[] = { 1.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; +* const float x[] = { 1.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; * * // Create an output strided array: * float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_srsqrt( N, x, strideX, y, strideY ); diff --git a/strided/special/ssqrt/README.md b/strided/special/ssqrt/README.md index 76841e30a..7d3b374e2 100644 --- a/strided/special/ssqrt/README.md +++ b/strided/special/ssqrt/README.md @@ -190,10 +190,10 @@ Computes the principal square root for each element in a single-precision floati ```c #include <stdint.h> -float X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; +const float X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_ssqrt( N, X, 2, Y, 2 ); ``` @@ -235,17 +235,17 @@ void stdlib_strided_ssqrt( const int64_t N, const float *X, const int64_t stride int main( void ) { // Create an input strided array: - float X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; + const float X[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; // Create an output strided array: float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_ssqrt( N, X, strideX, Y, strideY ); diff --git a/strided/special/ssqrt/examples/c/example.c b/strided/special/ssqrt/examples/c/example.c index 57e3874bb..009237aa7 100644 --- a/strided/special/ssqrt/examples/c/example.c +++ b/strided/special/ssqrt/examples/c/example.c @@ -22,17 +22,17 @@ int main( void ) { // Create an input strided array: - float x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; + const float x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; // Create an output strided array: float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_ssqrt( N, x, strideX, y, strideY ); diff --git a/strided/special/ssqrt/src/ssqrt.c b/strided/special/ssqrt/src/ssqrt.c index cfc54bee5..7e96a6aed 100644 --- a/strided/special/ssqrt/src/ssqrt.c +++ b/strided/special/ssqrt/src/ssqrt.c @@ -34,17 +34,17 @@ * #include <stdint.h> * * // Create an input strided array: -* float x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; +* const float x[] = { 0.0, 4.0, 9.0, 12.0, 24.0, 64.0, 81.0, 101.0 }; * * // Create an output strided array: * float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_ssqrt( N, x, strideX, y, strideY ); diff --git a/strided/special/strunc/README.md b/strided/special/strunc/README.md index bdcbf75ad..8b75c2f26 100644 --- a/strided/special/strunc/README.md +++ b/strided/special/strunc/README.md @@ -190,10 +190,10 @@ Rounds each element in a single-precision floating-point strided array `X` towar ```c #include <stdint.h> -float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +const float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_strunc( N, X, 2, Y, 2 ); ``` @@ -235,17 +235,17 @@ void stdlib_strided_strunc( const int64_t N, const float *X, const int64_t strid int main( void ) { // Create an input strided array: - float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create an output strided array: float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_strunc( N, X, strideX, Y, strideY ); diff --git a/strided/special/strunc/examples/c/example.c b/strided/special/strunc/examples/c/example.c index b2027bc1f..0aa1b61b3 100644 --- a/strided/special/strunc/examples/c/example.c +++ b/strided/special/strunc/examples/c/example.c @@ -22,17 +22,17 @@ int main( void ) { // Create an input strided array: - float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create an output strided array: float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_strunc( N, x, strideX, y, strideY ); diff --git a/strided/special/strunc/src/strunc.c b/strided/special/strunc/src/strunc.c index 7e5235e91..3519cf133 100644 --- a/strided/special/strunc/src/strunc.c +++ b/strided/special/strunc/src/strunc.c @@ -34,17 +34,17 @@ * #include <stdint.h> * * // Create an input strided array: -* float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +* const float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; * * // Create an output strided array: * float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_strunc( N, x, strideX, y, strideY );