Skip to content

Commit 6fa8a1b

Browse files
chore: address commit comments
PR-URL: #5875 Ref: 6d7317a#diff-cf1f66a7a4921a70d6e9a8690c83af82dd1c72754dc4f44c78976fd84d1d849b Reviewed-by: Athan Reines <[email protected]>
1 parent 24ba370 commit 6fa8a1b

File tree

6 files changed

+19
-55
lines changed

6 files changed

+19
-55
lines changed

lib/node_modules/@stdlib/math/base/special/sincos/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ stdlib_base_sincos( 4.0, &sine, &cosine );
127127
128128
The function accepts the following arguments:
129129
130-
- **x**: `[in] double` input value.
131-
- **sine**: `[out] double*` destination for the sine.
130+
- **x**: `[in] double` input value.
131+
- **sine**: `[out] double*` destination for the sine.
132132
- **cosine**: `[out] double*` destination for the cosine.
133133
134134
```c

lib/node_modules/@stdlib/math/base/special/sincos/benchmark/c/native/benchmark.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@ static double benchmark( void ) {
101101
for ( i = 0; i < ITERATIONS; i++ ) {
102102
x = ( 20.0 * rand_double() ) - 10.0;
103103
stdlib_base_sincos( x, &sine, &cosine );
104-
if ( cosine != cosine || sine != sine) {
104+
if ( cosine != cosine || sine != sine ) {
105105
printf( "unexpected results\n" );
106106
break;
107107
}
108108
}
109109
elapsed = tic() - t;
110-
if ( cosine != cosine || sine != sine) {
110+
if ( cosine != cosine || sine != sine ) {
111111
printf( "unexpected results\n" );
112112
}
113113
return elapsed;

lib/node_modules/@stdlib/math/base/special/sincos/docs/types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

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

23-
import { Collection } from '@stdlib/types/array';
23+
import { NumericArray } from '@stdlib/types/array';
2424

2525
interface SinCos {
2626
/**
@@ -67,7 +67,7 @@ interface SinCos {
6767
* var bool = ( v === out );
6868
* // returns true
6969
*/
70-
assign<T = unknown>( x: number, out: Collection<T>, stride: number, offset: number ): Collection<T | number>;
70+
assign<T extends NumericArray>( x: number, out: T, stride: number, offset: number ): T;
7171
}
7272

7373
/**

lib/node_modules/@stdlib/math/base/special/sincos/docs/types/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import sincos = require( './index' );
4949
{
5050
const out = [ 0.0, 0.0 ];
5151

52-
sincos.assign( 3.14e-319, out, 1, 0 ); // $ExpectType Collection<number>
52+
sincos.assign( 3.14e-319, out, 1, 0 ); // $ExpectType number[]
5353
}
5454

5555
// The compiler throws an error if the `assign` method is provided a first argument which is not a number...

lib/node_modules/@stdlib/math/base/special/sincos/test/test.assign.js

Lines changed: 6 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -48,42 +48,6 @@ tape( 'main export is a function', function test( t ) {
4848
t.end();
4949
});
5050

51-
tape( 'the function computes the sine and cosine (for -256*pi < x < 0)', function test( t ) {
52-
var cosine;
53-
var delta;
54-
var sine;
55-
var tol;
56-
var x;
57-
var y;
58-
var z;
59-
var i;
60-
61-
z = [ 0.0, 0.0 ];
62-
x = mediumNegative.x;
63-
sine = mediumNegative.sine;
64-
cosine = mediumNegative.cosine;
65-
66-
for ( i = 0; i < x.length; i++ ) {
67-
y = sincos( x[i], z, 1, 0 );
68-
t.equal( y, z, 'returns output array' );
69-
if ( y[0] === sine[ i ] ) {
70-
t.equal( y[0], sine[ i ], 'x: '+x[i]+'. Expected: '+sine[i] );
71-
} else {
72-
delta = abs( y[0] - sine[i] );
73-
tol = EPS * abs( sine[i] );
74-
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. Value: '+y[0]+'. Expected: '+sine[i]+'. tol: '+tol+'. delta: '+delta+'.' );
75-
}
76-
if ( y[1] === cosine[ i ] ) {
77-
t.equal( y[1], cosine[ i ], 'x: '+x[i]+'. Expected: '+cosine[i] );
78-
} else {
79-
delta = abs( y[1] - cosine[i] );
80-
tol = EPS * abs( cosine[i] );
81-
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. Value: '+y[1]+'. Expected: '+cosine[i]+'. tol: '+tol+'. delta: '+delta+'.' );
82-
}
83-
}
84-
t.end();
85-
});
86-
8751
tape( 'the function computes the sine and cosine (for -256*pi < x < 0)', function test( t ) {
8852
var cosine;
8953
var delta;
@@ -307,8 +271,8 @@ tape( 'the function returns `NaN` if provided a `NaN`', function test( t ) {
307271
z = [ 0.0, 0.0 ];
308272
v = sincos( NaN, z, 1, 0 );
309273
t.equal( v, z, 'returns output array' );
310-
t.equal( isnan( v[0] ), true, 'returns NaN' );
311-
t.equal( isnan( v[1] ), true, 'returns NaN' );
274+
t.equal( isnan( v[0] ), true, 'returns expected value' );
275+
t.equal( isnan( v[1] ), true, 'returns expected value' );
312276
t.end();
313277
});
314278

@@ -319,8 +283,8 @@ tape( 'the function returns `NaN` if provided `+infinity`', function test( t ) {
319283
z = [ 0.0, 0.0 ];
320284
v = sincos( PINF, z, 1, 0 );
321285
t.equal( v, z, 'returns output array' );
322-
t.equal( isnan( v[0] ), true, 'returns NaN' );
323-
t.equal( isnan( v[1] ), true, 'returns NaN' );
286+
t.equal( isnan( v[0] ), true, 'returns expected value' );
287+
t.equal( isnan( v[1] ), true, 'returns expected value' );
324288
t.end();
325289
});
326290

@@ -331,8 +295,8 @@ tape( 'the function returns `NaN` if provided `-infinity`', function test( t ) {
331295
z = [ 0.0, 0.0 ];
332296
v = sincos( NINF, z, 1, 0 );
333297
t.equal( v, z, 'returns output array' );
334-
t.equal( isnan( v[0] ), true, 'returns NaN' );
335-
t.equal( isnan( v[1] ), true, 'returns NaN' );
298+
t.equal( isnan( v[0] ), true, 'returns expected value' );
299+
t.equal( isnan( v[1] ), true, 'returns expected value' );
336300
t.end();
337301
});
338302

lib/node_modules/@stdlib/math/base/special/sincos/test/test.main.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,21 +247,21 @@ tape( 'the function computes the sine and cosine (for x >= 2**60 (PI/2))', funct
247247

248248
tape( 'the function returns `NaN` if provided a `NaN`', function test( t ) {
249249
var v = sincos( NaN );
250-
t.equal( isnan( v[0] ), true, 'returns NaN' );
251-
t.equal( isnan( v[1] ), true, 'returns NaN' );
250+
t.equal( isnan( v[0] ), true, 'returns expected value' );
251+
t.equal( isnan( v[1] ), true, 'returns expected value' );
252252
t.end();
253253
});
254254

255255
tape( 'the function returns `NaN` if provided `+infinity`', function test( t ) {
256256
var v = sincos( PINF );
257-
t.equal( isnan( v[0] ), true, 'returns NaN' );
258-
t.equal( isnan( v[1] ), true, 'returns NaN' );
257+
t.equal( isnan( v[0] ), true, 'returns expected value' );
258+
t.equal( isnan( v[1] ), true, 'returns expected value' );
259259
t.end();
260260
});
261261

262262
tape( 'the function returns `NaN` if provided `-infinity`', function test( t ) {
263263
var v = sincos( NINF );
264-
t.equal( isnan( v[0] ), true, 'returns NaN' );
265-
t.equal( isnan( v[1] ), true, 'returns NaN' );
264+
t.equal( isnan( v[0] ), true, 'returns expected value' );
265+
t.equal( isnan( v[1] ), true, 'returns expected value' );
266266
t.end();
267267
});

0 commit comments

Comments
 (0)