From d207be7d66511b700d25af7df41b12e8e0d9cc9a Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Tue, 5 Mar 2024 12:23:53 +0000 Subject: [PATCH] Auto-generated commit --- base/assert/is-odd/README.md | 97 +++++++++- .../is-odd/benchmark/benchmark.native.js | 61 +++++++ .../assert/is-odd/benchmark/c/native/Makefile | 146 +++++++++++++++ .../is-odd/benchmark/c/native/benchmark.c | 137 ++++++++++++++ base/assert/is-odd/binding.gyp | 170 ++++++++++++++++++ base/assert/is-odd/examples/c/Makefile | 146 +++++++++++++++ base/assert/is-odd/examples/c/example.c | 32 ++++ base/assert/is-odd/include.gypi | 53 ++++++ .../include/stdlib/math/base/assert/is_odd.h | 40 +++++ base/assert/is-odd/lib/index.js | 2 +- base/assert/is-odd/lib/main.js | 2 +- base/assert/is-odd/lib/native.js | 51 ++++++ base/assert/is-odd/manifest.json | 40 +++++ base/assert/is-odd/src/Makefile | 70 ++++++++ base/assert/is-odd/src/addon.c | 90 ++++++++++ base/assert/is-odd/src/main.c | 40 +++++ base/assert/is-odd/test/test.native.js | 96 ++++++++++ 17 files changed, 1268 insertions(+), 5 deletions(-) create mode 100644 base/assert/is-odd/benchmark/benchmark.native.js create mode 100644 base/assert/is-odd/benchmark/c/native/Makefile create mode 100644 base/assert/is-odd/benchmark/c/native/benchmark.c create mode 100644 base/assert/is-odd/binding.gyp create mode 100644 base/assert/is-odd/examples/c/Makefile create mode 100644 base/assert/is-odd/examples/c/example.c create mode 100644 base/assert/is-odd/include.gypi create mode 100644 base/assert/is-odd/include/stdlib/math/base/assert/is_odd.h create mode 100644 base/assert/is-odd/lib/native.js create mode 100644 base/assert/is-odd/manifest.json create mode 100644 base/assert/is-odd/src/Makefile create mode 100644 base/assert/is-odd/src/addon.c create mode 100644 base/assert/is-odd/src/main.c create mode 100644 base/assert/is-odd/test/test.native.js diff --git a/base/assert/is-odd/README.md b/base/assert/is-odd/README.md index fc60f612b..838420c5a 100644 --- a/base/assert/is-odd/README.md +++ b/base/assert/is-odd/README.md @@ -2,7 +2,7 @@ @license Apache-2.0 -Copyright (c) 2018 The Stdlib Authors. +Copyright (c) 2024 The Stdlib Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ limitations under the License. # isOdd -> Test if a finite numeric value is an odd number. +> Test if a finite double-precision floating-point number is an odd number.
@@ -32,7 +32,7 @@ var isOdd = require( '@stdlib/math/base/assert/is-odd' ); #### isOdd( x ) -Tests if a **finite** `numeric` value is an odd number. +Tests if a **finite** double-precision floating-point number is an odd number. ```javascript var bool = isOdd( 5.0 ); @@ -104,6 +104,97 @@ for ( i = 0; i < 100; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/assert/is_odd.h" +``` + +#### stdlib_base_is_odd( x ) + +Tests if a finite double-precision floating-point number is an odd number. + +```c +#include + +bool out = stdlib_base_is_odd( 1.0 ); +// returns true + +out = stdlib_base_is_odd( 4.0 ); +// returns false +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +bool stdlib_base_is_odd( const double x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/assert/is_odd.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_odd( x[ i ] ); + printf( "Value: %lf. Is Odd? %s.\n", x[ i ], ( b ) ? "True" : "False" ); + } +} +``` + +
+ + + +
+ + +