diff --git a/lib/node_modules/@stdlib/math/base/special/xlog1py/test/test.js b/lib/node_modules/@stdlib/math/base/special/xlog1py/test/test.js index b087ccf77ae0..dff24d1c3eb6 100644 --- a/lib/node_modules/@stdlib/math/base/special/xlog1py/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/xlog1py/test/test.js @@ -24,6 +24,8 @@ var tape = require( 'tape' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var EPS = require( '@stdlib/constants/float64/eps' ); var abs = require( '@stdlib/math/base/special/abs' ); +var PINF = require( '@stdlib/constants/float64/pinf' ); +var NINF = require( '@stdlib/constants/float64/ninf' ); var xlog1py = require( './../lib' ); @@ -173,3 +175,24 @@ tape( 'the function evaluates `x * ln(y+1)` for large `x` and `y`', function tes } t.end(); }); + +tape( 'the function handles infinite values', function test( t ) { + var out; + + out = xlog1py( PINF, 1.0 ); + t.strictEqual( out, PINF, 'returns expected value' ); + + out = xlog1py( PINF, 0.0 ); + t.strictEqual( isnan( out ), true, 'returns expected value' ); + + out = xlog1py( NINF, 1.0 ); + t.strictEqual( out, NINF, 'returns expected value' ); + + out = xlog1py( 2.0, PINF ); + t.strictEqual( out, PINF, 'returns expected value' ); + + out = xlog1py( -2.0, PINF ); + t.strictEqual( out, NINF, 'returns expected value' ); + + t.end(); +});