Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Nov 9, 2024
1 parent a0bbc8d commit 3e37816
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 15 deletions.
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,48 @@

> Package changelog.

<section class="release" id="unreleased">

## Unreleased (2024-11-09)

<section class="packages">

### Packages

</section>

<!-- /.packages -->

<section class="contributors">

### Contributors

A total of 1 person contributed to this release. Thank you to this contributor:

- Gunj Joshi

</section>

<!-- /.contributors -->

<section class="commits">

### Commits

<details>

- [`5a2ddbe`](https://github.com/stdlib-js/stdlib/commit/5a2ddbe402c98b9ea6aa989e248a3b26da375feb) - **docs:** correct the function description and indentation in `math/base/assert/is-odd` [(#3070)](https://github.com/stdlib-js/stdlib/pull/3070) _(by Gunj Joshi)_

</details>

</section>

<!-- /.commits -->

</section>

<!-- /.release -->

<section class="release" id="v0.3.3">

## 0.3.3 (2024-11-05)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
[npm-image]: http://img.shields.io/npm/v/@stdlib/math.svg
[npm-url]: https://npmjs.org/package/@stdlib/math

[test-image]: https://github.com/stdlib-js/math/actions/workflows/test.yml/badge.svg?branch=v0.3.3
[test-url]: https://github.com/stdlib-js/math/actions/workflows/test.yml?query=branch:v0.3.3
[test-image]: https://github.com/stdlib-js/math/actions/workflows/test.yml/badge.svg?branch=main
[test-url]: https://github.com/stdlib-js/math/actions/workflows/test.yml?query=branch:main

[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/math/main.svg
[coverage-url]: https://codecov.io/github/stdlib-js/math?branch=main
Expand Down
14 changes: 7 additions & 7 deletions base/assert/is-odd/examples/c/example.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
#include <stdbool.h>

int main( void ) {
const double x[] = { 5.0, -5.0, 3.14, -3.14, 0.0, 0.0/0.0 };
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" );
}
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" );
}
}
12 changes: 6 additions & 6 deletions base/assert/is-odd/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "stdlib/math/base/assert/is_even.h"

/**
* Test if a finite double-precision floating-point number is an odd number.
* Tests if a finite double-precision floating-point number is an odd number.
*
* @param x input value
* @return output value
Expand All @@ -32,9 +32,9 @@
* // returns true
*/
bool stdlib_base_is_odd( const double x ) {
// Check sign to prevent overflow...
if ( x > 0.0 ) {
return stdlib_base_is_even( x - 1.0 );
}
return stdlib_base_is_even( x + 1.0 );
// Check sign to prevent overflow...
if ( x > 0.0 ) {
return stdlib_base_is_even( x - 1.0 );
}
return stdlib_base_is_even( x + 1.0 );
}

0 comments on commit 3e37816

Please sign in to comment.