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 Jun 19, 2024
1 parent d3a3f52 commit a1dffa2
Show file tree
Hide file tree
Showing 17 changed files with 1,344 additions and 47 deletions.
25 changes: 24 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,34 @@

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

## Unreleased (2024-06-18)
## Unreleased (2024-06-19)

<section class="packages">

### Packages

<section class="package" id="math-base-assert-int32-is-even-unreleased">

#### [@stdlib/math/base/assert/int32-is-even](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/assert/int32-is-even)

<details>

<section class="features">

##### Features

- [`a8ce905`](https://github.com/stdlib-js/stdlib/commit/a8ce905a5ab79798b2dea0a97aef3bdaa65bb0c5) - add C implementation for `math/base/assert/int32-is-even`

</section>

<!-- /.features -->

</details>

</section>

<!-- /.package -->

<section class="package" id="math-base-assert-int32-is-odd-unreleased">

#### [@stdlib/math/base/assert/int32-is-odd](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/assert/int32-is-odd)
Expand Down Expand Up @@ -4688,6 +4710,7 @@ A total of 28 people contributed to this release. Thank you to the following con

<details>

- [`a8ce905`](https://github.com/stdlib-js/stdlib/commit/a8ce905a5ab79798b2dea0a97aef3bdaa65bb0c5) - **feat:** add C implementation for `math/base/assert/int32-is-even` _(by Rejoan Sardar, Philipp Burckhardt)_
- [`a4b2764`](https://github.com/stdlib-js/stdlib/commit/a4b276428bdc454a9412550375813f92bd242540) - **feat:** add C implementation for `math/base/special/vercos` [(##2397)](#2397 ) _(by Gunj Joshi)_
- [`06f8b4a`](https://github.com/stdlib-js/stdlib/commit/06f8b4ad6fd804cd127387fa6a645cce0ee05250) - **feat:** add C implementation for `math/base/special/versin` [(##2398)](#2398 ) _(by Gunj Joshi)_
- [`c811882`](https://github.com/stdlib-js/stdlib/commit/c8118827f71ca602ccfea2721df03afbbd3857e5) - **feat:** add C implementation for `math/base/special/cosd` [(##2393)](#2393) _(by Gunj Joshi)_
Expand Down
86 changes: 40 additions & 46 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -228,31 +228,14 @@ Developed at SunPro, a Sun Microsystems, Inc. business.
Permission to use, copy, modify, and distribute this
software is freely granted, provided that this notice
is preserved.

* FDLIBM <http://www.netlib.org/fdlibm/>

Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.

* SLATEC Common Mathematical Library <http://www.netlib.no/netlib/slatec/>

Public domain.

Stephen L. Moshier
[email protected]
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Developed at SunPro, a Sun Microsystems, Inc. business.
Permission to use, copy, modify, and distribute this
software is freely granted, provided that this notice
is preserved.

* Go <https://raw.githubusercontent.com/golang/go/master/LICENSE>

Expand Down Expand Up @@ -284,28 +267,24 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

* Faddeeva <http://ab-initio.mit.edu/wiki/index.php/Faddeeva_Package#License>
* SLATEC Common Mathematical Library <http://www.netlib.no/netlib/slatec/>

Copyright (c) 2012 Massachusetts Institute of Technology
Public domain.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
* FDLIBM <http://www.netlib.org/fdlibm/>

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.

* SpecialFunctions.jl <https://raw.githubusercontent.com/JuliaMath/
SpecialFunctions.jl/02a173fbe24a61c4b392aec17a9764ac5727feb1/LICENSE>
Expand Down Expand Up @@ -334,11 +313,26 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Developed at SunPro, a Sun Microsystems, Inc. business.
Permission to use, copy, modify, and distribute this
software is freely granted, provided that this notice
is preserved.
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
* Faddeeva <http://ab-initio.mit.edu/wiki/index.php/Faddeeva_Package#License>

Copyright (c) 2012 Massachusetts Institute of Technology

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

92 changes: 92 additions & 0 deletions base/assert/int32-is-even/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,98 @@ for ( i = 0; i < 100; i++ ) {

<!-- /.examples -->

<!-- C interface documentation. -->

* * *

<section class="c">

## C APIs

<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->

<section class="intro">

</section>

<!-- /.intro -->

<!-- C usage documentation. -->

<section class="usage">

### Usage

```c
#include "stdlib/math/base/assert/int32_is_even.h"
```

#### stdlib_base_int32_is_even( x )

Tests if 32-bit integer is even.

```c
#include <stdbool.h>

bool out = stdlib_base_int32_is_even( -2 );
// returns true

out = stdlib_base_int32_is_even( 5 );
// returns false
```

The function accepts the following arguments:

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

```c
bool stdlib_base_int32_is_even( const int32_t x );
```
</section>
<!-- /.usage -->
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
<section class="notes">
</section>
<!-- /.notes -->
<!-- C API usage examples. -->
<section class="examples">
### Examples
```c
#include "stdlib/math/base/assert/int32_is_even.h"
#include <stdio.h>
#include <stdbool.h>
#include <stdint.h>
int main( void ) {
const int32_t x[] = { 5, -5, 3, -3, 0, 2 };
bool b;
int i;
for ( i = 0; i < 5; i++ ) {
b = stdlib_base_int32_is_even( x[ i ] );
printf( "Value: %d. int32 Is even? %s.\n", x[ i ], ( b ) ? "True" : "False" );
}
}
```

</section>

<!-- /.examples -->

</section>

<!-- /.c -->

<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->

<section class="related">
Expand Down
61 changes: 61 additions & 0 deletions base/assert/int32-is-even/benchmark/benchmark.native.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/**
* @license Apache-2.0
*
* 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// MODULES //

var resolve = require( 'path' ).resolve;
var bench = require( '@stdlib/bench' );
var randu = require( '@stdlib/random/base/randu' );
var float64ToInt32 = require( '@stdlib/number/float64/base/to-float32' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var tryRequire = require( '@stdlib/utils/try-require' );
var pkg = require( './../package.json' ).name;


// VARIABLES //

var iseven = tryRequire( resolve( __dirname, './../lib/native.js' ) );
var opts = {
'skip': ( iseven instanceof Error )
};


// MAIN //

bench( pkg+'::native', opts, function benchmark( b ) {
var x;
var y;
var i;

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
x = ( randu()*1.0e7 ) - 5.0e6;
y = iseven( float64ToInt32( x ) );
if ( typeof y !== 'boolean' ) {
b.fail( 'should return a boolean' );
}
}
b.toc();
if ( !isBoolean( y ) ) {
b.fail( 'should return a boolean' );
}
b.pass( 'benchmark finished' );
b.end();
});
Loading

0 comments on commit a1dffa2

Please sign in to comment.