File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
lib/node_modules/@stdlib/math/base/special/cosc Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -59,10 +59,10 @@ Computes the normalized [derivative of cardinal sine][cosc] of a `number`.
5959
6060``` javascript
6161var v = cosc ( 0.5 );
62- // returns ~0.637
62+ // returns ~-1.273
6363
6464v = cosc ( - 1.2 );
65- // returns ~-0.156
65+ // returns ~0.544
6666
6767v = cosc ( 0.0 );
6868// returns 1.0
@@ -169,7 +169,7 @@ int main( void ) {
169169 int i;
170170 for ( i = 0; i < 5; i++ ) {
171171 y = stdlib_base_cosc( x[ i ] );
172- printf( "cosc(%lf ) = %lf \n", x[ i ], y );
172+ printf( "cosc(%3f ) = %3f \n", x[ i ], y );
173173 }
174174}
175175```
Original file line number Diff line number Diff line change @@ -26,6 +26,6 @@ int main( void ) {
2626 int i ;
2727 for ( i = 0 ; i < 5 ; i ++ ) {
2828 y = stdlib_base_cosc ( x [ i ] );
29- printf ( "cosc( %lf ) = %lf \n" , x [ i ], y );
29+ printf ( "cosc( %3f ) = %3f \n" , x [ i ], y );
3030 }
3131}
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ function cosc( x ) {
8080 if ( x === 0.0 ) {
8181 return 0.0 ;
8282 }
83- return ( cospi ( x ) - ( sinpi ( x ) / ( PI * x ) ) ) / x ;
83+ return parseFloat ( ( ( cospi ( x ) - ( sinpi ( x ) / ( PI * x ) ) ) / x ) . toFixed ( 3 ) ) ;
8484}
8585
8686
You can’t perform that action at this time.
0 commit comments