Skip to content

Commit

Permalink
fix: variable type declarations in math/base/assert/int32-is-odd
Browse files Browse the repository at this point in the history
In some places, the type declarations are inconsistent according to the function prototype
  • Loading branch information
performant23 committed Mar 17, 2024
1 parent c197430 commit a02b4ac
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ out = stdlib_base_int32_is_odd( -2 );

The function accepts the following arguments:

- **x**: `[in] double` input value.
- **x**: `[in] int32_t` input value.

```c
bool stdlib_base_int32_is_odd( const double x );
bool stdlib_base_int32_is_odd( const int32_t x );
```
</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var addon = require( './../src/addon.node' );
* Tests if a 32-bit integer is odd.
*
* @private
* @param {number} x - value to test
* @param {integer32} x - value to test
* @returns {boolean} boolean indicating whether the number is odd
*
* @example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ static napi_value addon( napi_env env, napi_callback_info info ) {
return NULL;
}

double x;
status = napi_get_value_double( env, argv[ 0 ], &x );
int32_t x;
status = napi_get_value_int32( env, argv[ 0 ], &x );
assert( status == napi_ok );

bool result = stdlib_base_int32_is_odd( x );
Expand Down

0 comments on commit a02b4ac

Please sign in to comment.