-
-
Notifications
You must be signed in to change notification settings - Fork 610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add C implementation for math/base/assert/int32-is-odd
#1865
Conversation
|
||
The function accepts the following arguments: | ||
|
||
- **x**: `[in] long` input value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- **x**: `[in] long` input value. | |
- **x**: `[in] int32_t` input value. |
- **x**: `[in] long` input value. | ||
|
||
```c | ||
bool stdlib_base_int32_is_odd( const long x ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool stdlib_base_int32_is_odd( const long x ); | |
bool stdlib_base_int32_is_odd( const int32_t x ); |
#include <stdbool.h> | ||
|
||
int main( void ) { | ||
const long x[] = { 5, -5, 3, -3, 0, 0/0 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const long x[] = { 5, -5, 3, -3, 0, 0/0 }; | |
const int32_t x[] = { 5, -5, 3, -3, 0 }; |
lib/node_modules/@stdlib/math/base/assert/int32-is-odd/README.md
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/math/base/assert/int32-is-odd/benchmark/c/native/benchmark.c
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/math/base/assert/int32-is-odd/benchmark/c/native/benchmark.c
Show resolved
Hide resolved
lib/node_modules/@stdlib/math/base/assert/int32-is-odd/benchmark/c/native/benchmark.c
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/math/base/assert/int32-is-odd/examples/c/example.c
Show resolved
Hide resolved
#include <stdbool.h> | ||
|
||
int main( void ) { | ||
const long x[] = { 5, -5, 3, -3, 0, 0/0 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const long x[] = { 5, -5, 3, -3, 0, 0/0 }; | |
const int32_t x[] = { 5, -5, 3, -3, 0 }; |
lib/node_modules/@stdlib/math/base/assert/int32-is-odd/examples/c/example.c
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/math/base/assert/int32-is-odd/README.md
Outdated
Show resolved
Hide resolved
/** | ||
* Tests if 32-bit integer is odd. | ||
*/ | ||
bool stdlib_base_is_odd( const long x ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool stdlib_base_is_odd( const long x ); | |
bool stdlib_base_int32_is_odd( const int32_t x ); |
...modules/@stdlib/math/base/assert/int32-is-odd/include/stdlib/math/base/assert/int32_is_odd.h
Show resolved
Hide resolved
lib/node_modules/@stdlib/math/base/assert/int32-is-odd/manifest.json
Outdated
Show resolved
Hide resolved
long x; | ||
status = napi_get_value_long( env, argv[ 0 ], &x ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
long x; | |
status = napi_get_value_long( env, argv[ 0 ], &x ); | |
int32_t x; | |
status = napi_get_value_int32( env, argv[ 0 ], &x ); |
lib/node_modules/@stdlib/math/base/assert/int32-is-odd/src/main.c
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/math/base/assert/int32-is-odd/src/main.c
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/math/base/assert/int32-is-odd/src/main.c
Outdated
Show resolved
Hide resolved
Signed-off-by: Pranav <[email protected]>
...modules/@stdlib/math/base/assert/int32-is-odd/include/stdlib/math/base/assert/int32_is_odd.h
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/math/base/assert/int32-is-odd/examples/c/example.c
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/math/base/assert/int32-is-odd/examples/c/example.c
Show resolved
Hide resolved
Signed-off-by: Pranav <[email protected]>
lib/node_modules/@stdlib/math/base/assert/int32-is-odd/src/main.c
Outdated
Show resolved
Hide resolved
Signed-off-by: Pranav <[email protected]>
...modules/@stdlib/math/base/assert/int32-is-odd/include/stdlib/math/base/assert/int32_is_odd.h
Outdated
Show resolved
Hide resolved
Signed-off-by: Pranav <[email protected]>
lib/node_modules/@stdlib/math/base/assert/int32-is-odd/examples/c/example.c
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/math/base/assert/int32-is-odd/README.md
Outdated
Show resolved
Hide resolved
Signed-off-by: Pranav <[email protected]>
math/base/assert/int32-is-odd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, everything works. Thanks @Rejoan-Sardar !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, everything works. Thanks @Rejoan-Sardar !
lib/node_modules/@stdlib/math/base/assert/int32-is-odd/README.md
Outdated
Show resolved
Hide resolved
...modules/@stdlib/math/base/assert/int32-is-odd/include/stdlib/math/base/assert/int32_is_odd.h
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/math/base/assert/int32-is-odd/src/main.c
Outdated
Show resolved
Hide resolved
Signed-off-by: Philipp Burckhardt <[email protected]>
Thanks @Rejoan-Sardar! Will merge ASAP. |
Resolves #1806 .
Description
This pull request:
Related Issues
This pull request:
@stdlib/math/base/assert/int32-is-odd
#1806 .Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers