From 759b22c710a6a750150a6f2f4648249bbe357067 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 8 Mar 2024 21:28:50 +0000 Subject: [PATCH] Auto-generated commit --- base/assert/is-nonpositive-integer/README.md | 91 ++++++++++ .../benchmark/benchmark.native.js | 61 +++++++ .../benchmark/c/native/Makefile | 146 +++++++++++++++ .../benchmark/c/native/benchmark.c | 137 ++++++++++++++ .../assert/is-nonpositive-integer/binding.gyp | 170 ++++++++++++++++++ .../examples/c/Makefile | 146 +++++++++++++++ .../examples/c/example.c | 32 ++++ .../is-nonpositive-integer/include.gypi | 53 ++++++ .../math/base/assert/is_nonpositive_integer.h | 40 +++++ .../is-nonpositive-integer/lib/native.js | 51 ++++++ .../is-nonpositive-integer/manifest.json | 40 +++++ .../is-nonpositive-integer/src/Makefile | 70 ++++++++ .../assert/is-nonpositive-integer/src/addon.c | 90 ++++++++++ base/assert/is-nonpositive-integer/src/main.c | 36 ++++ .../test/test.native.js | 94 ++++++++++ 15 files changed, 1257 insertions(+) create mode 100644 base/assert/is-nonpositive-integer/benchmark/benchmark.native.js create mode 100644 base/assert/is-nonpositive-integer/benchmark/c/native/Makefile create mode 100644 base/assert/is-nonpositive-integer/benchmark/c/native/benchmark.c create mode 100644 base/assert/is-nonpositive-integer/binding.gyp create mode 100644 base/assert/is-nonpositive-integer/examples/c/Makefile create mode 100644 base/assert/is-nonpositive-integer/examples/c/example.c create mode 100644 base/assert/is-nonpositive-integer/include.gypi create mode 100644 base/assert/is-nonpositive-integer/include/stdlib/math/base/assert/is_nonpositive_integer.h create mode 100644 base/assert/is-nonpositive-integer/lib/native.js create mode 100644 base/assert/is-nonpositive-integer/manifest.json create mode 100644 base/assert/is-nonpositive-integer/src/Makefile create mode 100644 base/assert/is-nonpositive-integer/src/addon.c create mode 100644 base/assert/is-nonpositive-integer/src/main.c create mode 100644 base/assert/is-nonpositive-integer/test/test.native.js diff --git a/base/assert/is-nonpositive-integer/README.md b/base/assert/is-nonpositive-integer/README.md index 9d7e43b27..69467691c 100644 --- a/base/assert/is-nonpositive-integer/README.md +++ b/base/assert/is-nonpositive-integer/README.md @@ -110,6 +110,97 @@ bool = isNonPositiveInteger( NaN ); + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/assert/is_nonpositive_integer.h" +``` + +#### stdlib_base_is_nonpositive_integer( x ) + +Tests if a finite double-precision floating-point number is a nonpositive integer. + +```c +#include + +bool out = stdlib_base_is_nonpositive_integer( -5.0 ); +// returns true + +out = stdlib_base_is_nonpositive_integer( 0.0 ); +// returns true +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +bool stdlib_base_is_nonpositive_integer( const double x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/assert/is_nonpositive_integer.h" +#include +#include + +int main( void ) { + const double x[] = { 5.0, -5.0, 3.14, -3.14, 0.0, 0.0/0.0 }; + + bool b; + int i; + for ( i = 0; i < 6; i++ ) { + b = stdlib_base_is_nonpositive_integer( x[ i ] ); + printf( "x = %lf, is_nonpositive_integer(x) = %s\n", x[ i ], ( b ) ? "True" : "False" ); + } +} +``` + +
+ + + +
+ + +