Skip to content

Commit 5a2ddbe

Browse files
authored
docs: correct the function description and indentation in math/base/assert/is-odd
PR-URL: #3070 Reviewed-by: Philipp Burckhardt <[email protected]> Signed-off-by: Gunj Joshi <[email protected]>
1 parent 24107e6 commit 5a2ddbe

File tree

2 files changed

+13
-13
lines changed
  • lib/node_modules/@stdlib/math/base/assert/is-odd

2 files changed

+13
-13
lines changed

lib/node_modules/@stdlib/math/base/assert/is-odd/examples/c/example.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
#include <stdbool.h>
2222

2323
int main( void ) {
24-
const double x[] = { 5.0, -5.0, 3.14, -3.14, 0.0, 0.0/0.0 };
24+
const double x[] = { 5.0, -5.0, 3.14, -3.14, 0.0, 0.0/0.0 };
2525

26-
bool b;
27-
int i;
28-
for ( i = 0; i < 6; i++ ) {
29-
b = stdlib_base_is_odd( x[ i ] );
30-
printf( "Value: %lf. Is Odd? %s.\n", x[ i ], ( b ) ? "True" : "False" );
31-
}
26+
bool b;
27+
int i;
28+
for ( i = 0; i < 6; i++ ) {
29+
b = stdlib_base_is_odd( x[ i ] );
30+
printf( "Value: %lf. Is Odd? %s.\n", x[ i ], ( b ) ? "True" : "False" );
31+
}
3232
}

lib/node_modules/@stdlib/math/base/assert/is-odd/src/main.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "stdlib/math/base/assert/is_even.h"
2121

2222
/**
23-
* Test if a finite double-precision floating-point number is an odd number.
23+
* Tests if a finite double-precision floating-point number is an odd number.
2424
*
2525
* @param x input value
2626
* @return output value
@@ -32,9 +32,9 @@
3232
* // returns true
3333
*/
3434
bool stdlib_base_is_odd( const double x ) {
35-
// Check sign to prevent overflow...
36-
if ( x > 0.0 ) {
37-
return stdlib_base_is_even( x - 1.0 );
38-
}
39-
return stdlib_base_is_even( x + 1.0 );
35+
// Check sign to prevent overflow...
36+
if ( x > 0.0 ) {
37+
return stdlib_base_is_even( x - 1.0 );
38+
}
39+
return stdlib_base_is_even( x + 1.0 );
4040
}

0 commit comments

Comments
 (0)