diff --git a/lib/node_modules/@stdlib/math/base/assert/is-even/README.md b/lib/node_modules/@stdlib/math/base/assert/is-even/README.md index 9d4b363dd520..6b2ae2fac241 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-even/README.md +++ b/lib/node_modules/@stdlib/math/base/assert/is-even/README.md @@ -2,7 +2,7 @@ @license Apache-2.0 -Copyright (c) 2018 The Stdlib Authors. +Copyright (c) 2024 The Stdlib Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -104,6 +104,97 @@ for ( i = 0; i < 100; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/assert/is_even.h" +``` + +#### stdlib_base_is_even( x ) + +Tests if a finite numeric value is an even number. + +```c +bool out = stdlib_base_is_even( 1.0 ); +// returns false + +out = stdlib_base_is_even( 4.0 ); +// returns true +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +bool stdlib_base_is_even( const double x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/assert/is_even.h" +#include +#include +#include + +int main( void ) { + double x; + bool v; + int i; + + for ( i = 0; i < 100; i++ ) { + x = ( ( (double)rand() / (double)RAND_MAX ) * 100.0 ); + v = stdlib_base_is_even( x ); + printf( "x = %lf, is_even(x) = %s\n", x, ( v ) ? "even" : "not even" ); + } +} +``` + +
+ + + +
+ + +