Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/math/base/special/sincosd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ stdlib_base_sincosd( 4.0, &sine, &cosine );

The function accepts the following arguments:

- **x**: `[in] double` input value.
- **sine**: `[out] double*` destination for the sine.
- **x**: `[in] double` input value.
- **sine**: `[out] double*` destination for the sine.
- **cosine**: `[out] double*` destination for the cosine.

```c
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ static double benchmark( void ) {
for ( i = 0; i < ITERATIONS; i++ ) {
x = ( 20.0 * rand_double() ) - 10.0;
stdlib_base_sincosd( x, &sine, &cosine );
if ( cosine != cosine || sine != sine) {
if ( cosine != cosine || sine != sine ) {
printf( "unexpected results\n" );
break;
}
}
elapsed = tic() - t;
if ( cosine != cosine || sine != sine) {
if ( cosine != cosine || sine != sine ) {
printf( "unexpected results\n" );
}
return elapsed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

/// <reference types="@stdlib/types"/>

import { Collection } from '@stdlib/types/array';
import { NumericArray } from '@stdlib/types/array';

interface sincosd {
/**
Expand Down Expand Up @@ -67,7 +67,7 @@ interface sincosd {
* var bool = ( v === out );
* // returns true
*/
assign<T = unknown>( x: number, out: Collection<T>, stride: number, offset: number ): Collection<T | number>;
assign<T extends NumericArray>( x: number, out: T, stride: number, offset: number ): T ;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import sincosd = require( './index' );
{
const out = [ 0.0, 0.0 ];

sincosd.assign( 3.14e-319, out, 1, 0 ); // $ExpectType Collection<number>
sincosd.assign( 3.14e-319, out, 1, 0 ); // $ExpectType number[]
}

// The compiler throws an error if the `assign` method is provided a first argument which is not a number...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

var bench = require( '@stdlib/bench' );
var Float64Array = require( '@stdlib/array/float64' );
var randu = require( '@stdlib/random/base/randu' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var EPS = require( '@stdlib/constants/float64/eps' );
var uniform = require( '@stdlib/random/base/uniform' );
var pkg = require( './../package.json' ).name;
var median = require( './../lib' );

Expand All @@ -42,8 +42,8 @@ bench( pkg, function benchmark( b ) {
mu = new Float64Array( len );
c = new Float64Array( len );
for ( i = 0; i < len; i++ ) {
mu[ i ] = ( randu() * 100.0 ) - 50.0;
c[ i ] = ( randu() * 20.0 ) + EPS;
mu[ i ] = uniform( -50.0, 50.0 );
c[ i ] = uniform( EPS, 20.0 + EPS );
}

b.tic();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ var resolve = require( 'path' ).resolve;
var bench = require( '@stdlib/bench' );
var Float64Array = require( '@stdlib/array/float64' );
var EPS = require( '@stdlib/constants/float64/eps' );
var randu = require( '@stdlib/random/base/randu' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var tryRequire = require( '@stdlib/utils/try-require' );
var uniform = require( '@stdlib/random/base/uniform' );
var pkg = require( './../package.json' ).name;


Expand All @@ -51,8 +51,8 @@ bench( pkg+'::native', opts, function benchmark( b ) {
mu = new Float64Array( len );
c = new Float64Array( len );
for ( i = 0; i < len; i++ ) {
mu[ i ] = ( randu() * 100.0 ) - 50.0;
c[ i ] = ( randu() * 20.0 ) + EPS;
mu[ i ] = uniform( -50.0, 50.0 );
c[ i ] = uniform( EPS, 20.0 + EPS );
}

b.tic();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,35 +53,35 @@ tape( 'main export is a function', opts, function test( t ) {

tape( 'if provided `NaN` for any parameter, the function returns `NaN`', opts, function test( t ) {
var y = median( NaN, 1.0 );
t.equal( isnan( y ), true, 'returns NaN' );
t.equal( isnan( y ), true, 'returns expected value' );
y = median( 1.0, NaN );
t.equal( isnan( y ), true, 'returns NaN' );
t.equal( isnan( y ), true, 'returns expected value' );
t.end();
});

tape( 'if provided a nonpositive `c`, the function returns `NaN`', opts, function test( t ) {
var y;

y = median( 2.0, 0.0 );
t.equal( isnan( y ), true, 'returns NaN' );
t.equal( isnan( y ), true, 'returns expected value' );

y = median( 2.0, -1.0 );
t.equal( isnan( y ), true, 'returns NaN' );
t.equal( isnan( y ), true, 'returns expected value' );

y = median( 2.0, -1.0 );
t.equal( isnan( y ), true, 'returns NaN' );
t.equal( isnan( y ), true, 'returns expected value' );

y = median( 1.0, NINF );
t.equal( isnan( y ), true, 'returns NaN' );
t.equal( isnan( y ), true, 'returns expected value' );

y = median( PINF, NINF );
t.equal( isnan( y ), true, 'returns NaN' );
t.equal( isnan( y ), true, 'returns expected value' );

y = median( NINF, NINF );
t.equal( isnan( y ), true, 'returns NaN' );
t.equal( isnan( y ), true, 'returns expected value' );

y = median( NaN, NINF );
t.equal( isnan( y ), true, 'returns NaN' );
t.equal( isnan( y ), true, 'returns expected value' );

t.end();
});
Expand Down
Loading