From 3fa9ed4c602b7f063ee6d85e315671d0572204c1 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 11 Mar 2024 23:38:05 +0000 Subject: [PATCH] Auto-generated commit --- LICENSE | 71 ++++---- base/assert/is-nonnegative-finite/README.md | 91 ++++++++++ .../benchmark/benchmark.native.js | 60 +++++++ .../benchmark/c/native/Makefile | 146 +++++++++++++++ .../benchmark/c/native/benchmark.c | 137 ++++++++++++++ base/assert/is-nonnegative-finite/binding.gyp | 170 ++++++++++++++++++ .../is-nonnegative-finite/examples/c/Makefile | 146 +++++++++++++++ .../examples/c/example.c | 32 ++++ .../assert/is-nonnegative-finite/include.gypi | 53 ++++++ .../math/base/assert/is_nonnegative_finite.h | 40 +++++ .../is-nonnegative-finite/lib/native.js | 51 ++++++ .../is-nonnegative-finite/manifest.json | 40 +++++ .../assert/is-nonnegative-finite/src/Makefile | 70 ++++++++ base/assert/is-nonnegative-finite/src/addon.c | 90 ++++++++++ base/assert/is-nonnegative-finite/src/main.c | 36 ++++ .../is-nonnegative-finite/test/test.native.js | 78 ++++++++ 16 files changed, 1274 insertions(+), 37 deletions(-) create mode 100644 base/assert/is-nonnegative-finite/benchmark/benchmark.native.js create mode 100644 base/assert/is-nonnegative-finite/benchmark/c/native/Makefile create mode 100644 base/assert/is-nonnegative-finite/benchmark/c/native/benchmark.c create mode 100644 base/assert/is-nonnegative-finite/binding.gyp create mode 100644 base/assert/is-nonnegative-finite/examples/c/Makefile create mode 100644 base/assert/is-nonnegative-finite/examples/c/example.c create mode 100644 base/assert/is-nonnegative-finite/include.gypi create mode 100644 base/assert/is-nonnegative-finite/include/stdlib/math/base/assert/is_nonnegative_finite.h create mode 100644 base/assert/is-nonnegative-finite/lib/native.js create mode 100644 base/assert/is-nonnegative-finite/manifest.json create mode 100644 base/assert/is-nonnegative-finite/src/Makefile create mode 100644 base/assert/is-nonnegative-finite/src/addon.c create mode 100644 base/assert/is-nonnegative-finite/src/main.c create mode 100644 base/assert/is-nonnegative-finite/test/test.native.js diff --git a/LICENSE b/LICENSE index d1534e6cb..5965a0b2c 100644 --- a/LICENSE +++ b/LICENSE @@ -207,28 +207,6 @@ FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -* Cephes - -Copyright (c) 1984-2000 Stephen L. Moshier - -Some software in this archive may be from the book _Methods and Programs for -Mathematical Functions_ (Prentice-Hall or Simon & Schuster International, 1989) -or from the Cephes Mathematical Library, a commercial product. In either event, -it is copyrighted by the author. What you see here may be used freely but it -comes with no support or guarantee. - -Stephen L. Moshier -moshier@na-net.ornl.gov - -* FreeBSD - -Copyright (C) 1993-2004 by Sun Microsystems, Inc. All rights reserved. - -Developed at SunPro, a Sun Microsystems, Inc. business. -Permission to use, copy, modify, and distribute this -software is freely granted, provided that this notice -is preserved. - * Go Copyright (c) 2009 The Go Authors. All rights reserved. @@ -259,6 +237,28 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* Cephes + +Copyright (c) 1984-2000 Stephen L. Moshier + +Some software in this archive may be from the book _Methods and Programs for +Mathematical Functions_ (Prentice-Hall or Simon & Schuster International, 1989) +or from the Cephes Mathematical Library, a commercial product. In either event, +it is copyrighted by the author. What you see here may be used freely but it +comes with no support or guarantee. + +Stephen L. Moshier +moshier@na-net.ornl.gov + +* FreeBSD + +Copyright (C) 1993-2004 by Sun Microsystems, Inc. All rights reserved. + +Developed at SunPro, a Sun Microsystems, Inc. business. +Permission to use, copy, modify, and distribute this +software is freely granted, provided that this notice +is preserved. + * Faddeeva Copyright (c) 2012 Massachusetts Institute of Technology @@ -282,13 +282,18 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. +* SLATEC Common Mathematical Library + +Public domain. + +* FDLIBM + +Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved. + +Developed at SunPro, a Sun Microsystems, Inc. business. +Permission to use, copy, modify, and distribute this +software is freely granted, provided that this notice +is preserved. Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -320,11 +325,3 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -* SLATEC Common Mathematical Library - -Public domain. - -* FDLIBM - -Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved. - diff --git a/base/assert/is-nonnegative-finite/README.md b/base/assert/is-nonnegative-finite/README.md index 889595f7d..f2dc444ef 100644 --- a/base/assert/is-nonnegative-finite/README.md +++ b/base/assert/is-nonnegative-finite/README.md @@ -84,6 +84,97 @@ bool = isNonNegativeFinite( NaN ); + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/assert/is_nonnegative_finite.h" +``` + +#### stdlib_base_is_nonnegative_finite( x ) + +Tests if a numeric value is a nonnegative finite number. + +```c +#include + +bool out = stdlib_base_is_nonnegative_finite( 3.14 ); +// returns true + +out = stdlib_base_is_nonnegative_finite( -2.0 ); +// returns false +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +bool stdlib_base_is_nonnegative_finite( const double x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/assert/is_nonnegative_finite.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_nonnegative_finite( x[ i ] ); + printf( "Value: %lf. Is nonnegative finite? %s.\n", x[ i ], ( b ) ? "True" : "False" ); + } +} +``` + +
+ + + +
+ + +