File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
lib/node_modules/@stdlib/lapack/base/dlapy2/test Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ var abs = require( '@stdlib/math/base/special/abs' );
27
27
var sqrt = require ( '@stdlib/math/base/special/sqrt' ) ;
28
28
var pow = require ( '@stdlib/math/base/special/pow' ) ;
29
29
var isPositiveZero = require ( '@stdlib/math/base/assert/is-positive-zero' ) ;
30
+ var isnan = require ( '@stdlib/math/base/assert/is-nan' ) ;
30
31
var dlapy2 = require ( './../lib' ) ;
31
32
32
33
@@ -61,6 +62,21 @@ tape( 'the function returns `+0` if both arguments are `+-0`', function test( t
61
62
t . end ( ) ;
62
63
} ) ;
63
64
65
+ tape ( 'the function returns `NaN` if either argument is `NaN`' , function test ( t ) {
66
+ var h ;
67
+
68
+ h = dlapy2 ( NaN , 0.0 ) ;
69
+ t . strictEqual ( isnan ( h ) , true , 'returns expected value' ) ;
70
+
71
+ h = dlapy2 ( 0.0 , NaN ) ;
72
+ t . strictEqual ( isnan ( h ) , true , 'returns expected value' ) ;
73
+
74
+ h = dlapy2 ( NaN , NaN ) ;
75
+ t . strictEqual ( isnan ( h ) , true , 'returns expected value' ) ;
76
+
77
+ t . end ( ) ;
78
+ } ) ;
79
+
64
80
tape ( 'the function computes the hypotenuse' , function test ( t ) {
65
81
var expected ;
66
82
var delta ;
You can’t perform that action at this time.
0 commit comments