diff --git a/lib/node_modules/@stdlib/math/base/assert/is-negative-finite/README.md b/lib/node_modules/@stdlib/math/base/assert/is-negative-finite/README.md index 0ede563e583..5562823bcf7 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-negative-finite/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-negative-finite/README.md @@ -112,6 +112,8 @@ bool = isNegativeFinite( NaN ); Tests if a double-precision floating-point numeric value is a negative finite number. ```c +#include + bool out = stdlib_base_is_negative_finite( 1.0 ); // returns false @@ -147,18 +149,17 @@ bool stdlib_base_is_negative_finite( const double x ); ```c #include "stdlib/math/base/assert/is_negative_finite.h" +#include "stdlib/constants/float64/ninf.h" #include -#include #include int main( void ) { - double x; - bool v; + const double x[] = { 5.0, -5.0, 3.14, -3.14, 0.0/0.0, STDLIB_CONSTANT_FLOAT64_NINF }; + + bool b; int i; - - for ( i = 0; i < 100; i++ ) { - x = ( ( (double)rand() / (double)RAND_MAX ) * 100.0 ); - v = stdlib_base_is_negative_finite( x ); + for ( i = 0; i < 6; i++ ) { + b = stdlib_base_is_negative_finite( x[ i ] ); printf( "x = %lf, is_negative_finite(x) = %s\n", x, ( v ) ? "True" : "False" ); } } diff --git a/lib/node_modules/@stdlib/math/base/assert/is-negative-finite/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/assert/is-negative-finite/benchmark/benchmark.native.js index 9e98eb4cb43..d53110d8939 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-negative-finite/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-negative-finite/benchmark/benchmark.native.js @@ -45,7 +45,7 @@ bench( pkg, opts, function benchmark( b ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = (randu()*200.0) - 100.0; + x = ( randu()*200.0 ) - 100.0; y = isNegativeFinite( x ); if ( typeof y !== 'boolean' ) { b.fail( 'should return a boolean' ); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-negative-finite/examples/c/example.c b/lib/node_modules/@stdlib/math/base/assert/is-negative-finite/examples/c/example.c index 985637c1fab..1eabc9da626 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-negative-finite/examples/c/example.c +++ b/lib/node_modules/@stdlib/math/base/assert/is-negative-finite/examples/c/example.c @@ -17,18 +17,16 @@ */ #include "stdlib/math/base/assert/is_negative_finite.h" +#include "stdlib/constants/float64/ninf.h" #include -#include #include int main( void ) { - double x; - bool v; + const double x[] = { 5.0, -5.0, 3.14, -3.14, 0.0/0.0, STDLIB_CONSTANT_FLOAT64_NINF }; + bool b; int i; - - for ( i = 0; i < 100; i++ ) { - x = ( ( (double)rand() / (double)RAND_MAX ) * 100.0 ); - v = stdlib_base_is_negative_finite( x ); + for ( i = 0; i < 6; i++ ) { + b = stdlib_base_is_negative_finite( x[ i ] ); printf( "x = %lf, is_negative_finite(x) = %s\n", x, ( v ) ? "True" : "False" ); } }