File tree Expand file tree Collapse file tree 1 file changed +7
-36
lines changed
lib/node_modules/@stdlib/math/base/special/binomcoeff/test Expand file tree Collapse file tree 1 file changed +7
-36
lines changed Original file line number Diff line number Diff line change @@ -98,45 +98,16 @@ tape( 'the function evaluates the binomial coefficient for integers `n` and `k`
9898 t . end ( ) ;
9999} ) ;
100100
101- tape ( 'the function returns `NaN` if the `n` value is not an integer ' , function test ( t ) {
102- var values ;
103- var i ;
101+ tape ( 'the function returns `NaN` if provided a non-integer number for any parameter ' , function test ( t ) {
102+ var v = binomcoeff ( 3.14 , 2 ) ;
103+ t . strictEqual ( isnanf ( v ) , true , 'returns expected value' ) ;
104104
105- values = [
106- 2.5 ,
107- '5' ,
108- null ,
109- true ,
110- void 0 ,
111- [ ] ,
112- { } ,
113- function noop ( ) { }
114- ] ;
115-
116- for ( i = 0 ; i < values . length ; i ++ ) {
117- t . strictEqual ( isnanf ( binomcoeff ( values [ i ] , 2 ) ) , true , 'returns expected value' ) ;
118- }
119- t . end ( ) ;
120- } ) ;
105+ v = binomcoeff ( 2 , 3.14 ) ;
106+ t . strictEqual ( isnanf ( v ) , true , 'returns expected value' ) ;
121107
122- tape ( 'the function returns `NaN` if the `k` value is not an integer' , function test ( t ) {
123- var values ;
124- var i ;
108+ v = binomcoeff ( 3.14 , 3.14 ) ;
109+ t . strictEqual ( isnanf ( v ) , true , 'returns expected value' ) ;
125110
126- values = [
127- 2.5 ,
128- '5' ,
129- null ,
130- true ,
131- void 0 ,
132- [ ] ,
133- { } ,
134- function noop ( ) { }
135- ] ;
136-
137- for ( i = 0 ; i < values . length ; i ++ ) {
138- t . strictEqual ( isnanf ( binomcoeff ( 2 , values [ i ] ) ) , true , 'returns expected value' ) ;
139- }
140111 t . end ( ) ;
141112} ) ;
142113
You can’t perform that action at this time.
0 commit comments