File tree 2 files changed +11
-11
lines changed
lib/node_modules/@stdlib/math/base/assert/is-even
2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 22
22
#include <stdbool.h>
23
23
24
24
int main ( void ) {
25
- double x ;
26
- bool v ;
27
- int i ;
28
-
29
- for ( i = 0 ; i < 100 ; i ++ ) {
30
- x = ( ( (double )rand () / (double )RAND_MAX ) * 100.0 );
31
- v = stdlib_base_is_even ( x );
32
- printf ( "x = %lf, is_even(x) = %s\n" , x , ( v ) ? "even" : "not even" );
33
- }
25
+ double x ;
26
+ bool v ;
27
+ int i ;
28
+
29
+ for ( i = 0 ; i < 100 ; i ++ ) {
30
+ x = ( ( (double )rand () / (double )RAND_MAX ) * 100.0 );
31
+ v = stdlib_base_is_even ( x );
32
+ printf ( "x = %lf, is_even(x) = %s\n" , x , ( v ) ? "even" : "not even" );
33
+ }
34
34
}
Original file line number Diff line number Diff line change 20
20
#include "stdlib/math/base/assert/is_integer.h"
21
21
22
22
/**
23
- * Test if a finite numeric value is an even number.
23
+ * Tests if a finite numeric value is an even number.
24
24
*
25
25
* @param x input value
26
26
* @return output value
32
32
* // returns false
33
33
*/
34
34
bool stdlib_base_is_even ( const double x ) {
35
- return stdlib_base_is_integer ( x / 2.0 );
35
+ return stdlib_base_is_integer ( x / 2.0 );
36
36
}
You can’t perform that action at this time.
0 commit comments