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 Apr 19, 2024
1 parent f72024b commit d5c3ecb
Show file tree
Hide file tree
Showing 11 changed files with 167 additions and 176 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ limitations under the License.
<p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p>
</details>

# Reciprocal Cube Root
# rcbrt

[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->

Expand Down Expand Up @@ -119,15 +119,13 @@ v = rcbrt( Infinity );
<!-- eslint no-undef: "error" -->

```javascript
var randu = require( '@stdlib/random-base-randu' );
var round = require( '@stdlib/math-base-special-round' );
var discreteUniform = require( '@stdlib/random-base-discrete-uniform' );
var rcbrt = require( '@stdlib/math-base-special-rcbrt' );

var x;
var i;

for ( i = 0; i < 100; i++ ) {
x = round( randu() * 100.0 );
x = discreteUniform( 0.0, 100.0 );
console.log( 'rcbrt(%d) = %d', x, rcbrt( x ) );
}
```
Expand Down
4 changes: 2 additions & 2 deletions benchmark/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ bench( pkg, function benchmark( b ) {

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
x = ( randu()*100000.0 ) - 0.0;
x = ( randu() * 100000.0 ) - 0.0;
y = rcbrt( x );
if ( isnan( y ) ) {
b.fail( 'should not return NaN' );
Expand All @@ -64,7 +64,7 @@ bench( pkg+'::built-in', opts, function benchmark( b ) {

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
x = ( randu()*100000.0 ) - 0.0;
x = ( randu() * 100000.0 ) - 0.0;
y = 1.0 / Math.cbrt( x ); // eslint-disable-line stdlib/no-builtin-math
if ( isnan( y ) ) {
b.fail( 'should not return NaN' );
Expand Down
2 changes: 1 addition & 1 deletion benchmark/benchmark.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ bench( pkg+'::native', opts, function benchmark( b ) {

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
x = ( randu()*100000.0 ) - 0.0;
x = ( randu() * 100000.0 ) - 0.0;
y = rcbrt( x );
if ( isnan( y ) ) {
b.fail( 'should not return NaN' );
Expand Down
2 changes: 1 addition & 1 deletion docs/repl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
0.1
> y = {{alias}}( 0.0 )
Infinity
> y = {{alias}}( Infinity )
> y = {{alias}}( {{alias:@stdlib/constants/float64/pinf}} )
0.0
> y = {{alias}}( -8.0 )
-0.5
Expand Down
6 changes: 2 additions & 4 deletions examples/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@

'use strict';

var randu = require( '@stdlib/random-base-randu' );
var round = require( '@stdlib/math-base-special-round' );
var discreteUniform = require( '@stdlib/random-base-discrete-uniform' );
var rcbrt = require( './../lib' );

var x;
var i;

for ( i = 0; i < 100; i++ ) {
x = round( randu() * 100.0 );
x = discreteUniform( 0.0, 100.0 );
console.log( 'rcbrt(%d) = %d', x, rcbrt( x ) );
}
18 changes: 6 additions & 12 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,12 @@
{
"task": "build",
"src": [
"./src/rcbrt.c"
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [
"-lm"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/math-base-napi-unary",
Expand All @@ -45,14 +43,12 @@
{
"task": "benchmark",
"src": [
"./src/rcbrt.c"
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [
"-lm"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/math-base-special-cbrt"
Expand All @@ -61,14 +57,12 @@
{
"task": "examples",
"src": [
"./src/rcbrt.c"
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [
"-lm"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/math-base-special-cbrt"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@stdlib/constants-float64-pinf": "^0.2.1",
"@stdlib/math-base-assert-is-nan": "^0.2.1",
"@stdlib/math-base-special-abs": "^0.2.1",
"@stdlib/math-base-special-round": "^0.2.1",
"@stdlib/random-base-discrete-uniform": "^0.2.1",
"@stdlib/random-base-randu": "^0.2.1",
"@stdlib/utils-try-require": "^0.2.1",
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
Expand Down
1 change: 1 addition & 0 deletions src/addon.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@
#include "stdlib/math/base/special/rcbrt.h"
#include "stdlib/math/base/napi/unary.h"

// cppcheck-suppress shadowFunction
STDLIB_MATH_BASE_NAPI_MODULE_D_D( stdlib_base_rcbrt )
4 changes: 2 additions & 2 deletions src/rcbrt.c → src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
/**
* Computes the reciprocal cube root of a double-precision floating-point number.
*
* @param x number
* @return reciprocal cube root
* @param x number
* @return reciprocal cube root
*
* @example
* double y = stdlib_base_rcbrt( 8.0 );
Expand Down
Loading

0 comments on commit d5c3ecb

Please sign in to comment.